/**
 * TurkeyProxy Core - Frontend Styles
 * Shared styles for customer portal
 */

:root {
    /* TurkeyProxy Brand Colors */
    --tp-primary: #0076fe;
    --tp-primary-dark: #0059b8;
    --tp-dark: #0f1822;
    --tp-gray: #94a3b8;
    --tp-light: #f1f1f1;
    --tp-white: #ffffff;
    
    /* Status Colors */
    --tp-success: #10b981;
    --tp-warning: #f59e0b;
    --tp-danger: #ef4444;
    --tp-info: #3b82f6;
    
    /* Spacing */
    --tp-space-xs: 4px;
    --tp-space-sm: 8px;
    --tp-space-md: 16px;
    --tp-space-lg: 24px;
    --tp-space-xl: 32px;
    
    /* Border Radius */
    --tp-radius-sm: 6px;
    --tp-radius-md: 10px;
    --tp-radius-lg: 16px;
    --tp-radius-full: 999px;
}

/* =========================================================================
   IP Table Styles
   ========================================================================= */

.tp-table-wrap {
    overflow-x: auto;
    border-radius: var(--tp-radius-md);
    background: var(--tp-white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tp-ip-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tp-ip-table thead th {
    background: var(--tp-dark);
    color: var(--tp-white);
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tp-ip-table tbody td {
    padding: 12px 14px;
    border-top: 1px solid #e6e6e6;
    vertical-align: middle;
}

.tp-ip-table tbody tr:hover {
    background: rgba(0, 118, 254, 0.03);
}

/* Row status classes */
.tp-status-expired td {
    background: rgba(239, 68, 68, 0.05) !important;
}

.tp-status-critical td {
    background: rgba(239, 68, 68, 0.08) !important;
}

.tp-status-warning td {
    background: rgba(245, 158, 11, 0.05) !important;
}

/* =========================================================================
   Copyable Code Elements
   ========================================================================= */

.tp-copyable {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--tp-light);
    border-radius: var(--tp-radius-sm);
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.tp-copyable:hover {
    background: #e2e8f0;
}

.tp-copyable:active {
    transform: scale(0.98);
}

.tp-copyable.copied {
    background: var(--tp-success);
    color: white;
}

.tp-ip-cell .tp-copyable {
    font-weight: 600;
}

/* =========================================================================
   Password Toggle
   ========================================================================= */

.tp-toggle-pass {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.tp-toggle-pass:hover {
    opacity: 1;
}

.tp-password-mask {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    letter-spacing: 2px;
    color: var(--tp-gray);
}

/* =========================================================================
   Badges
   ========================================================================= */

.tp-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: var(--tp-radius-full);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 6px;
}

.tp-badge-ok {
    background: rgba(16, 185, 129, 0.15);
    color: var(--tp-success);
}

.tp-badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--tp-warning);
}

.tp-badge-critical {
    background: rgba(239, 68, 68, 0.15);
    color: var(--tp-danger);
    animation: pulse-critical 2s infinite;
}

.tp-badge-expired {
    background: rgba(239, 68, 68, 0.2);
    color: var(--tp-danger);
}

@keyframes pulse-critical {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* =========================================================================
   Status Badges
   ========================================================================= */

.tp-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--tp-radius-full);
    font-size: 12px;
    font-weight: 500;
}

.tp-status-available {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.tp-status-in_use {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}

.tp-status-expired {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.tp-status-reserved {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

/* =========================================================================
   IP Count Pill
   ========================================================================= */

.tp-ip-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--tp-radius-full);
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-weight: 600;
    color: var(--tp-success);
    font-size: 14px;
}

/* =========================================================================
   Buttons
   ========================================================================= */

.tp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--tp-radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
}

.tp-btn-primary {
    background: var(--tp-primary);
    color: white;
}

.tp-btn-primary:hover {
    background: var(--tp-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 118, 254, 0.3);
}

.tp-btn-secondary {
    background: var(--tp-light);
    color: var(--tp-dark);
}

.tp-btn-secondary:hover {
    background: #e2e8f0;
}

.tp-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.tp-btn-danger {
    background: var(--tp-danger);
    color: white;
}

.tp-btn-danger:hover {
    background: #dc2626;
}

/* =========================================================================
   No IPs Message
   ========================================================================= */

.tp-no-ips {
    padding: var(--tp-space-lg);
    text-align: center;
    color: var(--tp-gray);
    background: var(--tp-light);
    border-radius: var(--tp-radius-md);
}

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 768px) {
    .tp-ip-table {
        font-size: 12px;
    }
    
    .tp-ip-table thead th,
    .tp-ip-table tbody td {
        padding: 10px 8px;
    }
    
    .tp-copyable {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .tp-badge {
        font-size: 10px;
        padding: 2px 6px;
    }
}
