/**
 * ProxyPanel v1 - Styles
 * by iLuminat1scode.com
 * Estilo Cyberpunk/Hacker
 */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800&family=Rajdhani:wght@400;500;600;700&display=swap');

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #030305;
    --bg-alt: #0a0a0f;
    --card: #0d0d14;
    --card-hover: #12121a;
    --border: #1a1a2e;
    --border-light: #252540;
    
    --accent: #00ff88;
    --accent-dark: #00cc6a;
    --accent-glow: rgba(0, 255, 136, 0.2);
    
    --pink: #ff0080;
    --pink-dark: #cc0066;
    --pink-glow: rgba(255, 0, 128, 0.2);
    
    --cyan: #00d4ff;
    --purple: #b537f2;
    
    --text: #e4e4e7;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;
    
    --success: #00ff88;
    --warning: #ffaa00;
    --danger: #ff4444;
    --info: #00d4ff;
    
    --sidebar-width: 260px;
    --header-height: 60px;
    
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    
    --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    background: var(--bg);
    font-family: 'Rajdhani', sans-serif;
    color: var(--text);
    line-height: 1.5;
    overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   FONDOS
═══════════════════════════════════════════════════════════════ */
.bg-grid {
    position: fixed;
    inset: 0;
    background: 
        linear-gradient(90deg, rgba(0,255,136,0.015) 1px, transparent 1px),
        linear-gradient(rgba(0,255,136,0.015) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

.bg-glow {
    position: fixed;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 70%;
    background: radial-gradient(ellipse at center, rgba(0,255,136,0.06) 0%, rgba(0,212,255,0.03) 40%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════════════ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-alt);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.logo-icon {
    color: var(--accent);
    font-size: 24px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.logo-text {
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 1px;
}

.daemon-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 11px;
    font-weight: 500;
}

.daemon-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.daemon-status.online { color: var(--success); }
.daemon-status.online .status-dot {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.daemon-status.offline { color: var(--danger); }
.daemon-status.offline .status-dot {
    background: var(--danger);
    box-shadow: 0 0 8px var(--danger);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #000;
}

.user-details { flex: 1; }

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    margin: 2px 10px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    font-size: 14px;
    font-weight: 500;
}

.nav-item:hover {
    background: var(--card);
    color: var(--text);
}

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent);
    border-left: 3px solid var(--accent);
    margin-left: 7px;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.credit-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--card);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.credit-display i {
    color: var(--accent);
}

.credit-amount {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

.credit-label {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: all var(--transition);
}

.btn-logout:hover {
    background: rgba(255, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

/* ═══════════════════════════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════════════════════════ */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 30px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.page-header {
    margin-bottom: 30px;
}

.page-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   STATS GRID
═══════════════════════════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition);
}

.stat-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #000;
}

.stat-icon.daemon-indicator {
    background: var(--card) !important;
    border: 1px solid var(--border);
}

.stat-icon.daemon-indicator.online {
    color: var(--success);
    border-color: var(--success);
}

.stat-icon.daemon-indicator.offline {
    color: var(--danger);
    border-color: var(--danger);
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    font-weight: 700;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════════════════ */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: var(--accent);
}

.card-body {
    padding: 24px;
}

/* ═══════════════════════════════════════════════════════════════
   TABLES
═══════════════════════════════════════════════════════════════ */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
}

.data-table th {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    border-bottom: 1px solid rgba(26, 26, 46, 0.5);
    font-size: 14px;
}

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background: var(--card-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ═══════════════════════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-success { background: rgba(0, 255, 136, 0.15); color: var(--success); }
.badge-danger { background: rgba(255, 68, 68, 0.15); color: var(--danger); }
.badge-warning { background: rgba(255, 170, 0, 0.15); color: var(--warning); }
.badge-info { background: rgba(0, 212, 255, 0.15); color: var(--info); }
.badge-secondary { background: rgba(161, 161, 170, 0.15); color: var(--text-secondary); }

.port-badge {
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 4px 10px;
    border-radius: 6px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.active { color: var(--success); }
.status-badge.active .status-dot { background: var(--success); box-shadow: 0 0 6px var(--success); }

.status-badge.inactive { color: var(--text-muted); }
.status-badge.inactive .status-dot { background: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #000;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-secondary {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #cc3333;
}

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

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
}

.btn-icon:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-icon.btn-danger:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(255, 68, 68, 0.1);
}

.action-buttons {
    display: flex;
    gap: 6px;
}

/* ═══════════════════════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    margin-bottom: 20px;
}

/* ═══════════════════════════════════════════════════════════════
   CONNECTION INFO
═══════════════════════════════════════════════════════════════ */
.connection-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.connection-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.connection-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.connection-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    color: var(--accent);
    flex: 1;
}

.connection-note {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.connection-note i {
    color: var(--info);
}

/* ═══════════════════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 500px;
    max-width: 94vw;
    max-height: 90vh;
    overflow-y: auto;
}

.popup {
    background: var(--card);
    border: 2px solid var(--accent);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 0 40px var(--accent-glow);
}

.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(180deg, rgba(0, 255, 136, 0.1), transparent);
    border-bottom: 1px solid var(--border);
}

.popup-header .logo-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.popup-header .logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
}

.popup-header .service-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    color: var(--accent);
}

.popup-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: all var(--transition);
}

.popup-close:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.popup-body {
    padding: 24px;
}

.popup-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.popup-footer-text {
    font-size: 11px;
    color: var(--text-muted);
}

/* Proxy details en modal */
.proxy-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.detail-row .label {
    color: var(--text-muted);
    font-size: 13px;
}

.detail-row .value {
    font-weight: 600;
}

.detail-section {
    margin-top: 16px;
}

.detail-section h4 {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.ip-list {
    list-style: none;
}

.ip-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(26, 26, 46, 0.5);
}

.ip-list li:last-child {
    border-bottom: none;
}

.ip-list code {
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 2px 8px;
    border-radius: 4px;
}

.ip-list small {
    color: var(--text-muted);
    font-size: 11px;
}

/* ═══════════════════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════════════════ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: all var(--transition);
}

.form-control:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .connection-info {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   SCROLLBAR
═══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ═══════════════════════════════════════════════════════════════
   TEXT UTILITIES
═══════════════════════════════════════════════════════════════ */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
