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

:root { 
    --primary: #6366F1; /* Indigo */
    --primary-dark: #4338CA; 
    --primary-light: #818CF8;
    --primary-glow: rgba(99, 102, 241, 0.15);
    
    --secondary: #D946EF; /* Fuchsia */
    --secondary-dark: #C084FC;
    
    --accent: #F59E0B; /* Amber */
    --success: #10B981; /* Emerald */
    --warning: #F59E0B; 
    --danger: #EF4444;
    --instructor: #8B5CF6; 
    --admin: #0F172A;
    --bg: #0B0F19; /* Dark premium background default */
    
    --card-bg: rgba(17, 24, 39, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.05);
    
    --text: #F3F4F6; 
    --text-muted: #9CA3AF;
    --sidebar: 320px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --radius-xl: 36px;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --anim-fast: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --anim-bounce: 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* New Dynamic Backgrounds for Visibility */
    --input-bg: rgba(17, 24, 39, 0.6);
    --input-focus-bg: rgba(17, 24, 39, 0.9);
    --select-option-bg: #111827;
    --sidebar-bg: rgba(17, 24, 39, 0.75);
    --header-bg: rgba(17, 24, 39, 0.4);
    --modal-bg: #0f172a;
    --modal-header-bg: rgba(15, 23, 42, 0.4);
    --toast-bg: #111827;
    --pill-bg: rgba(255, 255, 255, 0.05);
    --hover-bg: rgba(255, 255, 255, 0.04);
    --module-bg: var(--pill-bg);
    --quiz-icon-bg: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(99, 102, 241, 0.2));
    --task-icon-bg: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
}

/* Light Mode Override (if user preferences or class exists, but dark theme is premium standard) */
body.light-theme {
    --bg: #F8FAFC;
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(99, 102, 241, 0.08);
    --glass: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --text: #0F172A;
    --text-muted: #64748B;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.08);
    --shadow-xl: 0 20px 48px rgba(0,0,0,0.12);
    
    /* Light Mode Dynamic Backgrounds */
    --input-bg: rgba(255, 255, 255, 0.7);
    --input-focus-bg: rgba(255, 255, 255, 1);
    --select-option-bg: #FFFFFF;
    --sidebar-bg: rgba(255, 255, 255, 0.85);
    --header-bg: rgba(255, 255, 255, 0.7);
    --modal-bg: #FFFFFF;
    --modal-header-bg: rgba(241, 245, 249, 0.7);
    --toast-bg: #FFFFFF;
    --pill-bg: rgba(0, 0, 0, 0.05);
    --hover-bg: rgba(0, 0, 0, 0.04);
    --module-bg: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    --quiz-icon-bg: linear-gradient(135deg, #dbeafe, #bfdbfe);
    --task-icon-bg: linear-gradient(135deg, #d1fae5, #a7f3d0);
}

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

body { 
    font-family: var(--font-body); 
    background: var(--bg); 
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 60%),
        radial-gradient(at 100% 0%, rgba(217, 70, 239, 0.1) 0px, transparent 60%),
        radial-gradient(at 50% 100%, rgba(139, 92, 246, 0.08) 0px, transparent 60%);
    background-attachment: fixed;
    color: var(--text); 
    display: flex; 
    height: 100vh; 
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--anim-fast);
}

h1, h2, h3, h4, h5, h6, .page-title, .brand-title {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
    color: var(--text);
}

.hidden { display: none !important; }

/* Track Navigation Header Tabs */
.track-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 6px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    gap: 8px;
}
.track-tab {
    flex: 1;
    padding: 12px 16px;
    text-align: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--anim-bounce);
    color: var(--text-muted);
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.track-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}
.track-tab:hover:not(.active) {
    background: var(--hover-bg);
    color: var(--text);
}

/* Premium Buttons */
.btn { 
    padding: 14px 28px; 
    border-radius: var(--radius-md); 
    border: none; 
    font-weight: 700; 
    font-size: 15px;
    font-family: var(--font-heading);
    cursor: pointer; 
    width: 100%; 
    margin-top: 8px;
    position: relative;
    overflow: hidden;
    transition: all var(--anim-bounce);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 1;
    text-decoration: none;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255,255,255,0.15), transparent);
    z-index: -1;
    opacity: 0;
    transition: opacity var(--anim-fast);
}

.btn:hover { 
    transform: translateY(-3px) scale(1.02); 
    box-shadow: var(--shadow-glow);
}
.btn:hover::after { opacity: 1; }
.btn:active { transform: translateY(1px) scale(0.97); }

.btn-primary { 
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)); 
    color: white;
    box-shadow: 0 8px 24px -6px rgba(99, 102, 241, 0.6);
}
.btn-success { 
    background: linear-gradient(135deg, var(--success), #059669); 
    color: white;
    box-shadow: 0 8px 24px -6px rgba(16, 185, 129, 0.6);
}
.btn-warning {
    background: linear-gradient(135deg, var(--warning), #D97706);
    color: white;
    box-shadow: 0 8px 24px -6px rgba(245, 158, 11, 0.6);
}
.btn-danger {
    background: linear-gradient(135deg, var(--danger), #DC2626);
    color: white;
    box-shadow: 0 8px 24px -6px rgba(239, 68, 68, 0.6);
}
.btn-outline { 
    background: var(--glass); 
    border: 1px solid var(--glass-border); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}
.btn-outline:hover { 
    border-color: var(--primary-light); 
    color: white;
    background: rgba(99, 102, 241, 0.1);
}
.btn-ghost {
    background: transparent;
    color: var(--primary-light);
    box-shadow: none;
}
.btn-ghost:hover { background: rgba(99, 102, 241, 0.08); color: white; }
.btn-sm { padding: 10px 20px; font-size: 14px; border-radius: var(--radius-sm); }

/* Inputs and Forms */
input, select, textarea { 
    width: 100%; 
    padding: 16px 20px; 
    margin: 6px 0; 
    border: 1px solid var(--card-border); 
    border-radius: var(--radius-md); 
    box-sizing: border-box; 
    font-family: var(--font-body);
    font-size: 15px;
    background: var(--input-bg);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    transition: all var(--anim-fast);
    color: var(--text);
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    background: var(--input-focus-bg);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.25);
    transform: translateY(-1px);
}
input::placeholder { color: var(--text-muted); }
select option { background-color: var(--select-option-bg); color: var(--text); }

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

/* Sidebar Navigation */
.sidebar { 
    width: var(--sidebar); 
    background: var(--sidebar-bg); 
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-right: 1px solid var(--card-border); 
    display: flex; 
    flex-direction: column; 
    z-index: 20;
    box-shadow: 10px 0 30px rgba(0,0,0,0.25);
}
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }

.header { 
    padding: 24px 48px; 
    background: var(--header-bg); 
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--card-border); 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    z-index: 10;
}
.content { padding: 48px; overflow-y: auto; flex: 1; scroll-behavior: smooth; }

/* Cards & Grid Styling */
.card { 
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg); 
    padding: 36px; 
    box-shadow: var(--shadow-lg); 
    margin-bottom: 28px; 
    border: 1px solid var(--card-border);
    transition: all var(--anim-bounce);
    position: relative;
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    opacity: 0.4;
    transition: opacity var(--anim-fast), height var(--anim-fast);
}
.card:hover { 
    transform: translateY(-6px) scale(1.005); 
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    border-color: rgba(99, 102, 241, 0.3);
}
.card:hover::before { opacity: 1; height: 6px; }
.card-flat { box-shadow: none; border: 1px solid var(--card-border); }
.card-flat:hover { transform: none; box-shadow: var(--shadow-md); }
.card-accent { border-left: 5px solid var(--primary); }
.card-success { border-left: 5px solid var(--success); }
.card-warning { border-left: 5px solid var(--warning); }
.card-danger { border-left: 5px solid var(--danger); }

/* Navigation Items */
.nav-item { 
    display: flex; 
    align-items: center; 
    gap: 16px; 
    padding: 16px 20px; 
    border-radius: var(--radius-md); 
    cursor: pointer; 
    margin-bottom: 10px; 
    color: var(--text-muted);
    font-weight: 600;
    font-family: var(--font-heading);
    transition: all var(--anim-fast);
    position: relative;
    border: 1px solid transparent;
}
.nav-item:hover { 
    background: var(--hover-bg); 
    color: var(--text);
    transform: translateX(6px);
    border-color: var(--hover-bg);
}
.nav-item.active { 
    background: rgba(99, 102, 241, 0.1);
    color: white;
    border-color: rgba(99, 102, 241, 0.25);
    font-weight: 700;
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    bottom: 25%;
    width: 4px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}
.nav-item.locked { opacity: 0.35; pointer-events: none; filter: grayscale(1); }
.nav-ico { 
    width: 42px; 
    height: 42px; 
    display: grid; 
    place-items: center; 
    border-radius: 12px; 
    background: var(--pill-bg); 
    color: var(--text);
    font-size: 18px;
    transition: all var(--anim-fast);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}
.nav-item.active .nav-ico {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* File Drop Zone */
.file-drop { 
    border: 2px dashed rgba(99, 102, 241, 0.4); 
    padding: 48px; 
    text-align: center; 
    border-radius: var(--radius-lg); 
    cursor: pointer; 
    transition: all var(--anim-fast); 
    background: rgba(17, 24, 39, 0.4);
}
.file-drop:hover { 
    border-color: var(--primary); 
    background: rgba(99, 102, 241, 0.08);
    transform: scale(1.015);
}

/* Quiz Option styling */
.quiz-opt { 
    text-align: left; 
    background: var(--pill-bg); 
    border: 1px solid var(--card-border); 
    color: var(--text); 
    margin-bottom: 14px;
    border-radius: var(--radius-md);
    padding: 22px 26px;
    box-shadow: var(--shadow-sm);
    font-size: 16px;
    font-weight: 500;
    transition: all var(--anim-fast);
    cursor: pointer;
}
.quiz-opt:hover { 
    border-color: var(--primary-light); 
    background: rgba(99, 102, 241, 0.05);
    transform: translateX(8px);
    box-shadow: var(--shadow-md);
    color: var(--text);
}

/* Theme / Role styles */
body.role-instructor .sidebar { border-right-color: rgba(139, 92, 246, 0.2); }
body.role-instructor .btn-primary { 
    background: linear-gradient(135deg, var(--instructor), #7C3AED);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}
body.role-admin .btn-primary { 
    background: linear-gradient(135deg, var(--admin), #334155);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.4);
}

@media(max-width: 992px) {
    :root { --sidebar: 280px; }
}
@media(max-width: 768px) { 
    body { flex-direction: column; height: auto; overflow: auto; background-attachment: scroll; } 
    .sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--card-border); } 
    .header { flex-direction: column; align-items: flex-start; gap: 16px; padding: 24px; }
    .content { padding: 24px; }
    .card { padding: 28px; }
}

.hdr-controls { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.chip { 
    padding: 10px 18px; 
    border: 1px solid var(--card-border); 
    border-radius: var(--radius-md); 
    background: var(--pill-bg); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer; 
    font-size: 14px;
    font-weight: 600;
    transition: all var(--anim-fast);
    color: var(--text);
}
.chip:hover { border-color: var(--primary-light); background: var(--hover-bg); transform: translateY(-1px); }
.chip select { 
    padding: 4px 8px; 
    margin: 0; 
    border-radius: var(--radius-sm); 
    border: none; 
    font-size: 14px; 
    background: transparent;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    color: var(--text);
}

/* Modals */
.modal-backdrop { 
    position: fixed; 
    inset: 0; 
    background: rgba(7, 10, 18, 0.8); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 60; 
    padding: 20px;
    opacity: 0;
    animation: fadeIn var(--anim-fast) forwards;
}

@keyframes fadeIn { to { opacity: 1; } }

.modal { 
    width: min(900px, 100%); 
    background: var(--modal-bg); 
    border-radius: var(--radius-xl); 
    border: 1px solid var(--card-border);
    box-shadow: 0 32px 80px rgba(0,0,0,0.6); 
    overflow: hidden;
    transform: scale(0.95);
    animation: scaleUp var(--anim-bounce) forwards;
}
@keyframes scaleUp { to { transform: scale(1); } }

.modal header { 
    padding: 26px 36px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px solid var(--card-border);
    background: var(--modal-header-bg);
}
.modal .body { padding: 36px; max-height: 70vh; overflow: auto; line-height: 1.8; color: var(--text); }

/* Stats Widgets */
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-bottom: 36px; }
.stat-card {
    text-align: left;
    padding: 26px;
    border-radius: var(--radius-md);
    background: var(--pill-bg);
    border: 1px solid var(--card-border);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all var(--anim-fast);
}
.stat-card:hover {
    transform: translateY(-3px);
    background: var(--hover-bg);
}
.stat-card .icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    font-size: 26px;
}
.stat-card .value {
    font-size: 28px;
    font-weight: 800;
    font-family: var(--font-heading);
    margin-bottom: 2px;
}
.stat-card .label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.stat-card.purple .icon { background: rgba(139, 92, 246, 0.15); color: #A78BFA; }
.stat-card.blue .icon { background: rgba(37, 99, 235, 0.15); color: #93C5FD; }
.stat-card.green .icon { background: rgba(16, 185, 129, 0.15); color: #6EE7B7; }
.stat-card.amber .icon { background: rgba(245, 158, 11, 0.15); color: #FCD34D; }
.stat-card.rose .icon { background: rgba(225, 29, 72, 0.15); color: #FDA4AF; }

/* Gamification Progress Widget */
.xp-widget {
    background: linear-gradient(135deg, #1e1b4b, #111827);
    color: white;
    padding: 24px;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(99, 102, 241, 0.2);
}
.xp-widget::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    animation: rotate 20s linear infinite;
    z-index: 0;
}
.xp-widget > * { position: relative; z-index: 1; }
.xp-widget .xp-value { font-size: 24px; font-weight: 800; font-family: var(--font-heading); color: #E0E7FF; }
.xp-widget .xp-bar-bg {
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,0.06);
    border-radius: 5px;
    margin-top: 14px;
    overflow: hidden;
    position: relative;
}
.xp-widget .xp-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-light), var(--secondary));
    border-radius: 5px;
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}
.xp-widget .xp-bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}
@keyframes rotate { 100% { transform: rotate(360deg); } }
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* Audio Button styling */
.audio-btn { 
    width: auto; 
    padding: 12px 22px; 
    border-radius: var(--radius-md); 
    border: 1px solid var(--card-border); 
    background: var(--pill-bg); 
    cursor: pointer; 
    font-weight: 700; 
    font-size: 14px;
    transition: all var(--anim-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}
.audio-btn:hover { 
    border-color: var(--primary-light); 
    background: var(--hover-bg);
    transform: translateY(-2px);
    color: var(--text);
}

/* Brand Section */
.brand { 
    padding: 36px 28px; 
    text-align: center; 
    border-bottom: 1px solid var(--card-border);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.05), transparent);
}
.brand img { 
    display: block !important; 
    max-width: 140px !important; 
    height: auto !important; 
    object-fit: contain !important;
    margin: 0 auto;
    filter: drop-shadow(0 6px 12px rgba(99, 102, 241, 0.2));
}
.brand-title { 
    font-weight: 900; 
    font-size: 22px; 
    margin-top: 18px; 
    background: linear-gradient(135deg, #FFF, #C084FC);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.brand-sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; font-weight: 600; letter-spacing: 0.5px;}

.page-title { 
    font-weight: 900; 
    font-size: 26px; 
    background: linear-gradient(135deg, #FFF, var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Tables */
.admin-table { border-collapse: separate; border-spacing: 0; width: 100%; }
.admin-table th { 
    position: sticky; 
    top: 0; 
    background: var(--sidebar-bg);
    backdrop-filter: blur(10px);
    z-index: 1;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-align: left;
    padding: 18px 24px;
    border-bottom: 2px solid var(--card-border);
}
.admin-table td { padding: 18px 24px; border-bottom: 1px solid var(--card-border); color: var(--text); }
.admin-table tr { transition: all var(--anim-fast); }
.admin-table tr:hover { background: var(--hover-bg); }

.pill { 
    display: inline-flex; 
    padding: 6px 14px; 
    border-radius: 999px; 
    background: var(--pill-bg); 
    font-weight: 700; 
    font-size: 11px; 
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--card-border);
    align-items: center;
    justify-content: center;
    color: var(--text);
}
.pill-success { background: rgba(16, 185, 129, 0.15); color: #34D399; border-color: rgba(16, 185, 129, 0.3); }
.pill-warning { background: rgba(245, 158, 11, 0.15); color: #FBBF24; border-color: rgba(245, 158, 11, 0.3); }
.pill-danger { background: rgba(239, 68, 68, 0.15); color: #F87171; border-color: rgba(239, 68, 68, 0.3); }
.pill-info { background: rgba(99, 102, 241, 0.15); color: #818CF8; border-color: rgba(99, 102, 241, 0.3); }

.progress-bar { transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* Auth Overlay container */
#auth-overlay {
    background: radial-gradient(circle at center, #0F172A 0%, #030712 100%) !important;
}
#auth-overlay .card {
    background: rgba(17, 24, 39, 0.8);
    box-shadow: 0 30px 70px rgba(0,0,0,0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Tabs */
.tabs { display: flex; gap: 12px; margin-bottom: 32px; flex-wrap: wrap; }
.tab { 
    padding: 14px 26px; 
    border-radius: var(--radius-md); 
    background: var(--pill-bg); 
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border); 
    cursor: pointer; 
    font-weight: 700;
    font-size: 14px;
    font-family: var(--font-heading);
    transition: all var(--anim-bounce);
    color: var(--text-muted);
}
.tab:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); color: var(--text); }
.tab.active { 
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)); 
    color: white; 
    border-color: transparent; 
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

/* Insight and Recommendations styling */
.insight-card {
    background: linear-gradient(135deg, rgba(30, 27, 75, 0.6), rgba(17, 24, 39, 0.6));
    backdrop-filter: blur(15px);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 28px;
    border-left: 5px solid var(--primary);
    box-shadow: var(--shadow-md);
    transition: all var(--anim-bounce);
    border-top: 1px solid var(--card-border);
    border-right: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
}
.insight-card:hover { transform: translateX(6px); box-shadow: var(--shadow-lg); }
.insight-card h4 { margin: 0 0 12px; color: white; display: flex; align-items: center; gap: 10px; font-size: 18px; }
.insight-card p { margin: 0; color: var(--text-muted); font-size: 15px; line-height: 1.7; }

.recommendation-card {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.05), rgba(17, 24, 39, 0.6));
    backdrop-filter: blur(15px);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 28px;
    border-left: 5px solid var(--secondary);
    box-shadow: var(--shadow-md);
    transition: all var(--anim-bounce);
    border-top: 1px solid var(--card-border);
    border-right: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
}
.recommendation-card:hover { transform: translateX(6px); box-shadow: var(--shadow-lg); }
.recommendation-card h4 { margin: 0 0 12px; color: white; display: flex; align-items: center; gap: 10px; font-size: 18px; }
.recommendation-card p { margin: 0; color: var(--text-muted); font-size: 15px; line-height: 1.7; }

.activity-item {
    display: flex;
    gap: 18px;
    padding: 18px 0;
    border-bottom: 1px solid var(--card-border);
    transition: all var(--anim-fast);
}
.activity-item:hover { background: rgba(255, 255, 255, 0.01); border-radius: 8px; padding: 18px; margin: 0 -18px; }

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99, 102, 241, 0.3); }

.loading-spinner {
    width: 44px; height: 44px;
    border: 4px solid rgba(99, 102, 241, 0.1);
    border-left-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 30px auto;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.toast {
    min-width: 320px;
    background: var(--toast-bg);
    padding: 18px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--card-border);
    border-left: 5px solid var(--primary);
    transform: translateX(120%);
    transition: transform var(--anim-bounce);
    font-weight: 600;
    color: var(--text);
}
.toast.active { transform: translateX(0); }
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: var(--primary-light); }

.dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 10, 18, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn var(--anim-fast) forwards;
}
.dialog {
    background: var(--modal-bg);
    border: 1px solid var(--card-border);
    width: 100%;
    max-width: 440px;
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-xl);
    text-align: center;
    transform: scale(0.95);
    animation: scaleUp var(--anim-bounce) forwards;
}
.dialog-icon {
    font-size: 42px;
    margin-bottom: 24px;
}
.dialog-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text);
}
.dialog-msg {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 28px;
}
.dialog-actions {
    display: flex;
    gap: 14px;
}
