:root {
    --primary: #10b981;
    --primary-glow: rgba(16, 185, 129, 0.3);
    --secondary: #3b82f6;
    
    /* Dark Theme Default */
    --bg-dark: #020617;
    --bg-card: rgba(15, 23, 42, 0.8);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #f1f5f9;
    --text-dim: #94a3b8;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    --sidebar-bg: rgba(15, 23, 42, 0.95);
}

body.light-theme {
    --bg-dark: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.08);
    --text-main: #0f172a;
    --text-dim: #64748b;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --sidebar-bg: rgba(255, 255, 255, 0.95);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* Background Animation */
.bg-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150vw;
    height: 150vw;
    background: radial-gradient(circle at center, var(--primary-glow) 0%, transparent 70%);
    filter: blur(80px);
    z-index: -1;
    opacity: 0.5;
    animation: pulse 10s infinite alternate;
}

@keyframes pulse {
    from { transform: translate(-50%, -50%) scale(0.8); }
    to { transform: translate(-50%, -50%) scale(1.2); }
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 30px;
    text-align: center;
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.nav-menu {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-item {
    padding: 15px 20px;
    border-radius: 12px;
    color: var(--text-dim);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.nav-item i { font-size: 1.2rem; min-width: 25px; }

.nav-item:hover, .nav-item.active {
    background: var(--primary-glow);
    color: white;
    transform: translateX(5px);
}

.nav-item.active {
    background: var(--primary);
    box-shadow: 0 10px 20px var(--primary-glow);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--glass-border);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

#page-title {
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1.2rem;
}

.clock {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: var(--primary);
}

.theme-switch {
    width: 45px;
    height: 45px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    color: var(--primary);
}

.theme-switch:hover {
    transform: rotate(15deg) scale(1.1);
    background: var(--primary-glow);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
}

/* Sections */
.app-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.app-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards & Stats */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s;
}

.stat-card:hover { transform: translateY(-5px); }

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.icon-green { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.icon-red { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.icon-yellow { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.icon-blue { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }

.stat-info .label { color: var(--text-dim); font-size: 0.8rem; }
.stat-info h3 { font-family: 'Orbitron'; margin-top: 5px; }

/* Scanner */
.scanner-container {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.mode-selector {
    display: flex;
    background: var(--bg-card);
    padding: 5px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.mode-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: none;
    color: var(--text-dim);
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    transition: 0.3s;
}

.mode-btn.active {
    background: var(--primary);
    color: white;
}

.scan-frame {
    border: 3px solid var(--primary);
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 30px var(--primary-glow);
    margin-bottom: 20px;
}

/* Modals */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active { display: flex; }

.modal-content {
    width: 90%;
    max-width: 400px;
    padding: 40px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
}

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; color: var(--text-dim); font-size: 0.9rem; }
.form-group input {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    outline: none;
}

.form-divider {
    grid-column: 1 / -1;
    margin: 20px 0 10px;
    padding-bottom: 5px;
    border-bottom: 1px dashed var(--glass-border);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.settings-grid-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}

@media (max-width: 600px) {
    .settings-grid-cols { grid-template-columns: 1fr; }
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-secondary {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    padding: 15px 25px;
    border-radius: 12px;
    cursor: pointer;
}

.text-green { color: var(--primary); }
.text-red { color: var(--danger); }

.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 15px 30px var(--primary-glow); }

.btn-login {
    width: 100%;
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    padding: 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
}

/* Loader */
.loader-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.cyber-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(16, 185, 129, 0.1);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

/* Table */
.table-scroll { overflow-x: auto; margin-top: 20px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 15px; color: var(--text-dim); font-size: 0.8rem; text-transform: uppercase; border-bottom: 1px solid var(--glass-border); }
td { padding: 15px; border-bottom: 1px solid var(--glass-border); }

/* Responsive */
@media (max-width: 900px) {
    .sidebar { position: fixed; left: -280px; }
    .sidebar.active { transform: translateX(280px); }
    .menu-toggle { display: block; }
    .main-content { padding: 20px; }
}
