:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #475569;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --dark: #0f172a;
    --light: #f1f5f9;
    --border: #cbd5e1;
    --text: #1e293b;
    --text-light: #475569;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Subject Colors - More academic/professional */
    --biology: #059669;
    --chemistry: #ea580c;
    --physics: #0284c7;
    --maths: #7c3aed;
    --english: #be123c;
    --history: #b45309;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    background: var(--light);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 20px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--dark);
    font-size: 24px;
    font-weight: 800;
}

.logo i {
    color: var(--primary);
}

.logo:hover {
    text-decoration: none;
    color: var(--primary);
}

.nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: color 0.2s;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    text-decoration: none;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--dark);
    border-radius: 2px;
    transition: all 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--dark);
    border-radius: 2px;
    transition: all 0.3s;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* User Menu */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(37, 99, 235, 0.08);
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    color: var(--primary);
    transition: background 0.2s;
}

.user-menu:hover {
    background: rgba(37, 99, 235, 0.12);
}

.user-menu i {
    font-size: 20px;
    color: var(--primary);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    padding-top: 8px;
    background: transparent;
    min-width: 180px;
    display: none;
    z-index: 1000;
}

.user-dropdown::before {
    content: '';
    display: block;
    height: 8px;
}

.user-dropdown-content {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.user-menu:hover .user-dropdown,
.user-dropdown:hover {
    display: block;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.user-dropdown a:hover {
    background: rgba(37, 99, 235, 0.08);
    text-decoration: none;
}

.user-dropdown a i {
    width: 16px;
    text-align: center;
    color: var(--text-light);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #1e40af 0%, #0f172a 100%);
    color: white;
    padding: 80px 20px 100px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 20px;
    margin-bottom: 32px;
    opacity: 0.95;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    max-width: 600px;
    margin: 0 auto;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.2s;
    border: 2px solid transparent;
    cursor: pointer;
}

.btn-large {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    text-decoration: none;
    color: white;
}

.btn-outline {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-outline:hover {
    background: white;
    color: var(--primary);
    border-color: white;
    text-decoration: none;
}

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

.btn-secondary:hover {
    background: var(--light);
    text-decoration: none;
    color: var(--primary);
}

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: 36px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 12px;
}

.section-header p {
    font-size: 18px;
    color: var(--text-light);
}

/* Subjects Section */
.subjects {
    padding: 80px 20px;
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.subject-card {
    background: white;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--subject-color);
}

.subject-card.biology { --subject-color: var(--biology); }
.subject-card.chemistry { --subject-color: var(--chemistry); }
.subject-card.physics { --subject-color: var(--physics); }
.subject-card.maths { --subject-color: var(--maths); }
.subject-card.english { --subject-color: var(--english); }
.subject-card.history { --subject-color: var(--history); }

.subject-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--subject-color);
}

.subject-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--subject-color), var(--subject-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.subject-card h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.subject-questions {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 20px;
}

.subject-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Features Section */
.features {
    padding: 80px 20px;
    background: white;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.feature-card {
    text-align: center;
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Footer */
.footer {
    background: var(--dark);
    color: white;
    padding: 60px 20px 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.footer-logo i {
    color: var(--primary);
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.footer-column h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.footer-column a {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 8px;
    transition: color 0.2s;
}

.footer-column a:hover {
    color: white;
    text-decoration: none;
}

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

/* Mobile-only navigation links (Settings & Logout) */
.mobile-only-links {
    display: none; /* Hidden on desktop - only visible in mobile menu */
}

.mobile-auth-buttons {
    display: none; /* Hidden on desktop - only visible in mobile menu */
}

/* Responsive */
@media (max-width: 968px) {
    .nav {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        box-shadow: var(--shadow-lg);
        gap: 0;
        display: none;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
    
    .nav.active,
    .nav.open {
        display: flex;
    }
    
    .mobile-menu-toggle,
    .nav-toggle {
        display: flex;
    }
    
    .nav-link {
        padding: 14px 16px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .nav-link:hover {
        background: var(--light);
    }
    
    .nav-link.active {
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
        color: white;
    }
    
    .nav-link.active::after {
        display: none;
    }
    
    /* Show Settings & Logout ONLY in mobile menu */
    .mobile-only-links {
        display: flex;
        flex-direction: column;
        gap: 0;
        border-top: 2px solid var(--border);
        margin-top: 12px;
        padding-top: 12px;
    }
    
    .mobile-only-links .nav-link {
        color: var(--text);
        font-weight: 600;
    }
    
    .mobile-only-links .nav-link i {
        width: 20px;
        text-align: center;
        font-size: 16px;
    }
    
    /* Show Sign In and Create account buttons in mobile menu */
    .mobile-auth-buttons {
        display: flex;
        flex-direction: column;
        gap: 12px;
        border-top: 2px solid var(--border);
        margin-top: 12px;
        padding-top: 12px;
    }
    
    .mobile-auth-buttons .nav-link {
        color: var(--text);
        font-weight: 600;
        text-align: center;
        padding: 12px 16px;
    }
    
    .mobile-auth-buttons .nav-link.btn {
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
        color: white;
        border-radius: 8px;
    }
    
    .mobile-auth-buttons .nav-link.btn:hover {
        background: linear-gradient(135deg, var(--primary-dark) 0%, #1e3a8a 100%);
        color: white;
    }
    
    /* Hide user profile menu on mobile (Settings/Logout now in nav) */
    .user-menu {
        display: none !important;
    }
    
    .header-right {
        display: none; /* Hide entire header-right section on mobile */
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .hero-subtitle {
        font-size: 18px;
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid var(--primary);
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
}

.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); }

.toast-icon {
    font-size: 20px;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--primary); }

.toast-content {
    flex: 1;
}

.toast-message {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.toast-close:hover {
    background: var(--light);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 32px;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .btn-large {
        width: 100%;
        justify-content: center;
    }
    
    .subjects-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .toast-container {
        left: 20px;
        right: 20px;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
    }
}

