* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec489a;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --dark: #0f0f23;
    --darker: #0a0a1a;
    --light: #ffffff;
    --glass-bg: rgba(15, 25, 45, 0.75);
    --glass-border: rgba(99, 102, 241, 0.3);
    --card-bg: rgba(20, 30, 55, 0.6);
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--dark) 0%, var(--darker) 100%);
    min-height: 100vh;
    color: var(--light);
    overflow-x: hidden;
}

.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--primary);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background: var(--secondary);
    bottom: -250px;
    right: -250px;
    animation-delay: -5s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: var(--primary-light);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

#networkCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.role-card {
    max-width: 700px;
    width: 90%;
    padding: 50px 40px;
    text-align: center;
    animation: slideUp 0.6s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.role-header .icon-wrapper {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.role-header .icon-wrapper i {
    font-size: 40px;
    color: white;
}

.role-header h1 {
    font-size: 32px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.role-header p {
    opacity: 0.7;
    margin-bottom: 40px;
}

.role-options {
    display: flex;
    gap: 25px;
    justify-content: center;
    flex-wrap: wrap;
}

.role-option {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 220px;
}

.role-option:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.2);
}

.role-icon {
    width: 70px;
    height: 70px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.role-icon i {
    font-size: 35px;
    color: var(--primary);
}

.role-option h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.role-option p {
    font-size: 13px;
    opacity: 0.7;
    margin-bottom: 15px;
}

.role-tag {
    font-size: 11px;
    background: rgba(99, 102, 241, 0.3);
    padding: 5px 10px;
    border-radius: 20px;
    display: inline-block;
}

.login-card {
    max-width: 420px;
    width: 90%;
    padding: 45px 35px;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.lock-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.lock-icon i {
    font-size: 32px;
    color: white;
}

.login-header h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.login-header p {
    font-size: 14px;
    opacity: 0.7;
}

.input-field {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    margin-bottom: 18px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.input-field:focus-within {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(5px);
}

.input-field i {
    color: var(--primary);
    font-size: 18px;
}

.input-field input {
    width: 100%;
    padding: 16px 12px;
    background: transparent;
    border: none;
    color: var(--light);
    font-size: 15px;
    outline: none;
}

.input-field input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.password-field {
    position: relative;
}

.toggle-password {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    font-size: 18px;
}

.toggle-password:hover {
    color: var(--primary);
}

.login-note {
    background: rgba(99, 102, 241, 0.15);
    border-radius: 10px;
    padding: 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

.login-note i {
    color: var(--primary);
}

.login-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
    gap: 15px;
}

.back-button {
    text-align: center;
    margin-top: 20px;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.back-button:hover {
    opacity: 1;
    color: var(--primary);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 14px 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-radius: 50px;
    border-left: 4px solid var(--success);
    z-index: 1100;
    animation: slideInRight 0.3s ease;
    font-size: 14px;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

@media (max-width: 768px) {
    .role-options {
        flex-direction: column;
    }
    
    .role-option {
        width: 100%;
    }
    
    .role-card {
        padding: 30px 20px;
    }
}

/* ==================== COMPLETE THEME SYSTEM ==================== */

/* Base theme variables */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec489a;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --dark: #0f0f23;
    --darker: #0a0a1a;
    --light: #ffffff;
    --glass-bg: rgba(15, 25, 45, 0.75);
    --glass-border: rgba(99, 102, 241, 0.3);
    --card-bg: rgba(20, 30, 55, 0.6);
    --text-primary: #ffffff;
    --text-secondary: rgba(255,255,255,0.7);
    --border-color: rgba(255,255,255,0.1);
}

/* Theme 1: Exam Pro */
body.theme-exam {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec489a;
    --dark: #0f0f23;
    --darker: #0a0a1a;
    --glass-bg: rgba(15, 25, 45, 0.75);
    --glass-border: rgba(99, 102, 241, 0.3);
    --card-bg: rgba(20, 30, 55, 0.6);
    --text-primary: #ffffff;
    --text-secondary: rgba(255,255,255,0.7);
    --border-color: rgba(255,255,255,0.1);
}

body.theme-exam {
    background: linear-gradient(135deg, #0f0f23 0%, #0a0a1a 100%);
}

/* Theme 2: Cyber Student */
body.theme-cyber {
    --primary: #00ff88;
    --primary-dark: #00cc6a;
    --primary-light: #33ff99;
    --secondary: #ff00ff;
    --success: #00ff88;
    --warning: #ffaa00;
    --error: #ff3300;
    --dark: #0a0a0a;
    --darker: #000000;
    --light: #00ff88;
    --glass-bg: rgba(0, 0, 0, 0.85);
    --glass-border: rgba(0, 255, 136, 0.3);
    --card-bg: rgba(0, 20, 10, 0.6);
    --text-primary: #00ff88;
    --text-secondary: rgba(0, 255, 136, 0.7);
    --border-color: rgba(0, 255, 136, 0.2);
}

body.theme-cyber {
    background: linear-gradient(135deg, #0a0a0a 0%, #000000 100%);
}

/* Theme 3: Government (Black & White Professional) - DEFAULT */
body.theme-government {
    --primary: #1a1a2e;
    --primary-dark: #0f0f1a;
    --primary-light: #2d2d44;
    --secondary: #4a4a6a;
    --success: #228b22;
    --warning: #ff8c00;
    --error: #c41e3a;
    --dark: #f5f5f5;
    --darker: #ffffff;
    --light: #1a1a2e;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.1);
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --border-color: rgba(0, 0, 0, 0.08);
}

body.theme-government {
    background: linear-gradient(135deg, #f0f2f5 0%, #ffffff 100%);
}

/* Theme 3 specific overrides */
body.theme-government .animated-bg .gradient-orb {
    opacity: 0.1;
}

body.theme-government .navbar,
body.theme-government .glass {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

body.theme-government .topic-card,
body.theme-government .quiz-card,
body.theme-government .results-card,
body.theme-government .ai-card,
body.theme-government .feedback-card,
body.theme-government .social-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

body.theme-government .topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: #1a1a2e;
}

body.theme-government .subject-title,
body.theme-government .card-title {
    color: #1a1a2e;
}

body.theme-government .subject-description,
body.theme-government .description {
    color: #4a4a6a;
}

body.theme-government .subject-stats {
    background: rgba(0, 0, 0, 0.05);
    color: #1a1a2e;
}

body.theme-government .start-btn,
body.theme-government .btn-primary {
    background: linear-gradient(135deg, #1a1a2e, #0f0f1a);
    color: white;
}

body.theme-government .start-btn:hover,
body.theme-government .btn-primary:hover {
    background: linear-gradient(135deg, #2d2d44, #1a1a2e);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

body.theme-government .gradient-text {
    background: linear-gradient(135deg, #1a1a2e, #4a4a6a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

body.theme-government .stat i,
body.theme-government .quiz-info-item i,
body.theme-government .logo i {
    color: #1a1a2e;
}

body.theme-government .progress-fill {
    background: linear-gradient(90deg, #1a1a2e, #4a4a6a);
}

body.theme-government .option:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.theme-government .option.selected {
    background: rgba(0, 0, 0, 0.1);
    border-color: #1a1a2e;
}

body.theme-government .user-greeting h2 {
    color: #1a1a2e;
}

body.theme-government .user-greeting p {
    color: #4a4a6a;
}

body.theme-government .role-badge {
    background: rgba(0, 0, 0, 0.05);
    color: #1a1a2e;
}

body.theme-government .logout-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a2e;
}

body.theme-government .logout-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

body.theme-government .chat-input-area input,
body.theme-government .feedback-textarea {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a2e;
}

body.theme-government .chat-input-area input::placeholder,
body.theme-government .feedback-textarea::placeholder {
    color: #999;
}

body.theme-government .chat-input-area button {
    background: #1a1a2e;
    color: white;
}

body.theme-government .user-message {
    background: #1a1a2e;
    color: white;
}

body.theme-government .bot-message {
    background: rgba(0, 0, 0, 0.05);
    color: #1a1a2e;
}

body.theme-government .footer p {
    color: #4a4a6a;
}

body.theme-government .social-link {
    background: rgba(0, 0, 0, 0.05);
    color: #1a1a2e;
}

body.theme-government .social-link:hover {
    background: rgba(0, 0, 0, 0.1);
}

body.theme-government .theme-btn {
    border: 2px solid rgba(0, 0, 0, 0.1);
}

body.theme-government .theme-btn.active {
    border-color: #1a1a2e;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

/* Theme button styles */
.theme-switcher {
    display: flex;
    gap: 8px;
    background: var(--glass-bg);
    padding: 6px 12px;
    border-radius: 40px;
    border: 1px solid var(--glass-border);
}

.theme-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.theme-btn:hover {
    transform: scale(1.1);
}

.theme-btn.active {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.theme-exam {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.theme-cyber-btn {
    background: linear-gradient(135deg, #00ff88, #00cc6a);
}

.theme-gov-btn {
    background: linear-gradient(135deg, #ceb6b6, #e8e7d9);
}

/* Footer Styles */
.footer {
    text-align: center;
    margin-top: 60px;
    padding: 25px;
    border-top: 1px solid var(--border-color);
}

.footer p {
    margin: 8px 0;
    opacity: 0.6;
    font-size: 13px;
    color: var(--text-secondary);
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}