:root {
    --ink: #17251f;
    --green: #175c45;
    --bright: #d7ff64;
    --cream: #f8f5ee;
    --paper: #fffdf8;
    --orange: #ff7043;
    --line: #d9ded8;
    --muted: #66736d;

    --primary: #175c45;
    --primary-dark: #0e3d2e;
    --secondary: #66736d;
    --success: #175c45;
    --warning: #ff7043;
    --danger: #dc2626;
    --dark: #17251f;
    --light: #fffdf8;
    --border: #d9ded8;
    --text: #17251f;
    --text-light: #66736d;
    --shadow: 4px 4px 0 #17251f;
    --shadow-lg: 8px 8px 0 #17251f;

    --biology: #17684d;
    --chemistry: #b44321;
    --physics: #315ea7;
    --maths: #61751b;
    --english: #7343a1;
    --history: #976514;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--paper);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: Georgia, 'Times New Roman', serif;
    letter-spacing: -0.04em;
}

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

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.8px;
    color: var(--ink);
}

.auth-card {
    border: 2px solid var(--ink);
    box-shadow: 8px 8px 0 var(--ink);
}

/* Header */
.header {
    background: var(--cream);
    border-bottom: 1px solid #ddd5c7;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

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

.header-right .login-link {
    font-size: 14px;
    font-weight: 800;
    color: #44504b;
}

.header-right .login-link:hover {
    color: var(--green);
}

.logo {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    color: var(--dark);
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.8px;
}

.brand-mark {
    background: var(--green);
    width: 38px;
    height: 38px;
    color: var(--bright);
    border-radius: 11px;
    place-items: center;
    font-family: Georgia, serif;
    font-size: 24px;
    font-style: italic;
    font-weight: 600;
    display: grid;
    transform: rotate(-4deg);
    flex: none;
}

.logo-accent {
    color: var(--green);
}

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

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

.nav {
    display: flex;
    align-items: center;
    gap: 34px;
    margin-left: auto;
}

.nav-link {
    color: #44504b;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: color 0.2s;
    position: relative;
}

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--bright);
    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: #effaf3;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    color: var(--green);
    transition: background 0.2s;
}

.user-menu:hover {
    background: #d9f3e7;
}

.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: #fff;
    border-radius: 10px;
    box-shadow: 5px 5px 0 var(--ink);
    border: 1px solid var(--ink);
    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: #f2f7d9;
    text-decoration: none;
}

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

/* Inner-page heroes */
.page-hero,
.courses-hero {
    background: var(--cream);
    color: var(--ink);
    border-block: 1px solid #ddd5c7;
    padding: 64px 20px 72px;
    text-align: center;
}

.page-hero h1,
.courses-hero h1 {
    font-size: clamp(38px, 5vw, 56px);
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.05;
    letter-spacing: -2px;
}

.page-hero p,
.courses-hero p {
    font-size: 18px;
    color: var(--muted);
    max-width: 640px;
    margin: 0 auto;
    font-family: Arial, Helvetica, sans-serif;
    letter-spacing: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 22px;
    border-radius: 10px;
    font-weight: 900;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.18s;
    border: 2px solid var(--ink);
    cursor: pointer;
    font-family: Arial, Helvetica, sans-serif;
    letter-spacing: 0;
}

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

.btn-small {
    padding: 12px 17px;
    font-size: 13px;
}

.btn-primary {
    background: var(--bright);
    color: var(--ink);
    border-color: var(--ink);
    box-shadow: 4px 4px 0 var(--ink);
}

.btn-primary:hover {
    background: var(--bright);
    border-color: var(--ink);
    box-shadow: 7px 7px 0 var(--ink);
    transform: translate(-2px, -2px);
    text-decoration: none;
    color: var(--ink);
}

.header-right .btn-primary,
.btn-header {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
    box-shadow: none;
}

.header-right .btn-primary:hover,
.btn-header:hover {
    box-shadow: 4px 4px 0 var(--bright);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--ink);
    border-color: var(--ink);
}

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

.btn-secondary {
    background: #fff;
    color: var(--ink);
    border-color: var(--ink);
}

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

.btn-dark {
    background: var(--ink);
    color: #fff;
    box-shadow: none;
}

.btn-dark:hover {
    color: #fff;
    box-shadow: 4px 4px 0 var(--green);
}

/* 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: var(--bright);
    color: var(--ink);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--ink);
    border: 2px solid var(--ink);
}

.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: #fff;
    color: var(--ink);
    width: 100%;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    max-width: 1200px;
    margin: auto;
    padding: 56px 28px 28px;
}

.footer .logo,
.footer-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.8px;
    text-decoration: none;
    color: var(--ink);
}

.footer .logo:hover {
    color: var(--ink);
}

.footer-tagline {
    color: var(--muted);
    grid-row: 2;
    font-size: 13px;
    margin-top: 10px;
    font-family: Arial, Helvetica, sans-serif;
}

.footer nav,
.footer-links {
    grid-area: 1 / 2 / 3;
    gap: 28px;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    flex-wrap: wrap;
    font-family: Arial, Helvetica, sans-serif;
}

.footer nav a,
.footer-links a {
    color: var(--ink);
    text-decoration: none;
}

.footer nav a:hover,
.footer-links a:hover {
    color: var(--green);
}

.footer-bottom {
    border-top: 1px solid var(--line);
    color: var(--muted);
    grid-column: 1 / -1;
    justify-content: space-between;
    margin-top: 36px;
    padding-top: 18px;
    font-size: 15px;
    display: flex;
    font-family: Arial, Helvetica, sans-serif;
}

.footer-bottom a {
    color: inherit;
    text-decoration: none;
}

.footer-content {
    display: contents;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 11px;
}

.footer-column {
    display: none;
}

/* 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: 82px;
        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: var(--green);
        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: var(--green);
        color: white;
        border-radius: 10px;
        border: 2px solid var(--green);
    }
    
    .mobile-auth-buttons .nav-link.btn:hover {
        background: var(--green);
        color: white;
        box-shadow: 4px 4px 0 var(--bright);
    }
    
    /* 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-inner {
        grid-template-columns: 1fr;
    }

    .footer nav,
    .footer-links {
        flex-wrap: wrap;
        grid-area: 3 / 1;
        margin-top: 25px;
    }

    .footer-bottom {
        grid-row: 4;
        flex-direction: column;
        gap: 10px;
    }
}

/* 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;
    }
}

