/* ===================================================
   LearnPro - Main Stylesheet
   Modern Learning Platform UI
=================================================== */






/* CSS Variables */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    --bg: #ffffff;
    --bg-2: #f8fafc;
    --bg-3: #f1f5f9;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --text: #0f172a;
    --text-2: #334155;
    --text-3: #64748b;
    --text-4: #94a3b8;

    --nav-height: 70px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.05);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,.07), 0 4px 6px -2px rgba(0,0,0,.05);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.08), 0 10px 10px -5px rgba(0,0,0,.04);
    --shadow-xl: 0 25px 50px -12px rgba(0,0,0,.12);

    --font-sans: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Instrument Serif', Georgia, serif;

    --transition: 0.2s ease;
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg: #0f172a;
    --bg-2: #1e293b;
    --bg-3: #334155;
    --bg-card: #1e293b;
    --border: #334155;
    --border-light: #1e293b;
    --text: #f1f5f9;
    --text-2: #e2e8f0;
    --text-3: #94a3b8;
    --text-4: #64748b;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
    --shadow: 0 4px 6px -1px rgba(0,0,0,.3);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,.3);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.4);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
    transition: background var(--transition-slow), color var(--transition-slow);
    overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }

/* Typography */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.25; color: var(--text); }
h1 { font-size: clamp(2rem, 4vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.75rem); }
h4 { font-size: 1.125rem; }
p { color: var(--text-2); line-height: 1.7; }

/* =================== NAVBAR =================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--nav-height);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition-slow), box-shadow var(--transition);
}
[data-theme="dark"] .navbar {
    background: rgba(15,23,42,0.92);
}
.navbar.scrolled { box-shadow: var(--shadow-md); }

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.brand-name {
    font-size: 1.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}
.nav-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-3);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    transition: all var(--transition);
}
.btn-icon:hover { background: var(--bg-3); color: var(--text); }

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    border-radius: var(--radius-sm);
}
.hamburger span {
    width: 22px;
    height: 2px;
    background: var(--text-2);
    border-radius: 2px;
    transition: all var(--transition);
    display: block;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* User Menu */
.nav-user { position: relative; }
.user-avatar-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border);
    transition: border-color var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.user-avatar-btn:hover { border-color: var(--primary); }
.avatar-img { width: 100%; height: 100%; object-fit: cover; }
.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition);
    overflow: hidden;
}
.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dropdown-header strong { font-size: 0.9rem; color: var(--text); }
.dropdown-header span { font-size: 0.8rem; color: var(--text-3); }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 0.875rem;
    color: var(--text-2);
    transition: all var(--transition);
}
.dropdown-item:hover { background: var(--bg-2); color: var(--primary); }
.dropdown-item.danger:hover { background: #fef2f2; color: var(--danger); }
[data-theme="dark"] .dropdown-item.danger:hover { background: rgba(239,68,68,0.1); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}
.search-overlay.show { opacity: 1; visibility: visible; }
.search-container { width: 100%; max-width: 680px; padding: 0 24px; }
.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-xl);
}
.search-input-wrap svg { color: var(--text-3); flex-shrink: 0; }
.search-input-wrap input {
    flex: 1;
    border: none;
    background: none;
    font-size: 1.1rem;
    color: var(--text);
    outline: none;
}
.search-close { color: var(--text-3); padding: 4px; transition: color var(--transition); }
.search-close:hover { color: var(--danger); }

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}
.overlay.show { opacity: 1; visibility: visible; }

/* =================== BUTTONS =================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-sans);
    transition: all var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
    white-space: nowrap;
    text-decoration: none;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.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(-1px); box-shadow: 0 8px 25px rgba(99,102,241,0.35); }
.btn-secondary { background: var(--secondary); color: white; border-color: var(--secondary); }
.btn-secondary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-2); color: var(--text); }
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 16px 32px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-full { width: 100%; }

/* =================== HERO =================== */
.hero {
    padding: 80px 0 100px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 50%, #fff7f0 100%);
}
[data-theme="dark"] .hero { background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%); }

.hero::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
    top: -200px;
    right: -100px;
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139,92,246,0.08) 0%, transparent 70%);
    bottom: -100px;
    left: -50px;
    pointer-events: none;
}

.hero-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.2);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 24px;
    animation: fadeInDown 0.6s ease;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); animation: pulse 2s infinite; }

.hero-title {
    font-size: clamp(2.4rem, 4.5vw, 4rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    animation: fadeInUp 0.6s ease 0.1s both;
}
.hero-title .gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-3);
    margin-bottom: 36px;
    max-width: 520px;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease 0.3s both;
}

.hero-stats {
    display: flex;
    gap: 32px;
    margin-top: 40px;
    animation: fadeInUp 0.6s ease 0.4s both;
}
.stat-item { text-align: center; }
.stat-num { font-size: 1.8rem; font-weight: 800; color: var(--text); }
.stat-label { font-size: 0.8rem; color: var(--text-3); font-weight: 500; }

.hero-visual {
    display: flex;
    justify-content: center;
    animation: fadeInRight 0.8s ease 0.2s both;
}
.hero-card-stack { position: relative; width: 380px; height: 460px; }
.hero-main-card {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    border: 1px solid var(--border);
}
.hero-card-img { height: 200px; background: linear-gradient(135deg, #6366f1, #8b5cf6); position: relative; overflow: hidden; }
.hero-card-img-inner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-card-body { padding: 24px; }
.hero-float-card {
    position: absolute;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 14px 18px;
    border: 1px solid var(--border);
    animation: float 3s ease-in-out infinite;
}
.hero-float-card.card-1 { bottom: 40px; right: -20px; }
.hero-float-card.card-2 { top: 40px; right: -30px; animation-delay: 1s; }
.float-card-inner { display: flex; align-items: center; gap: 10px; }
.float-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }

/* =================== SECTIONS =================== */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-2); }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 52px;
}
.section-eyebrow {
    display: inline-block;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}
.section-title { margin-bottom: 16px; }
.section-desc { color: var(--text-3); font-size: 1.05rem; }

/* =================== COURSE CARDS =================== */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.course-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-slow);
    display: flex;
    flex-direction: column;
}
.course-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(99,102,241,0.2);
}

.course-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: linear-gradient(135deg, #e0e7ff, #ede9fe);
}
.course-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.course-card:hover .course-thumbnail img { transform: scale(1.05); }
.course-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-free { background: var(--success); color: white; }
.badge-paid { background: var(--accent); color: white; }
.badge-featured { background: var(--primary); color: white; }
.badge-new { background: #ec4899; color: white; }

.course-level {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(0,0,0,0.55);
    color: white;
    backdrop-filter: blur(4px);
}

.course-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.course-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.course-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.course-instructor {
    font-size: 0.8rem;
    color: var(--text-3);
    margin-bottom: 12px;
}
.course-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--text-3);
}
.meta-item svg { flex-shrink: 0; }

.course-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
}
.stars { display: flex; gap: 2px; }
.star { color: var(--accent); }
.star.empty { color: var(--border); }
.rating-count { font-size: 0.78rem; color: var(--text-3); }

.course-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}
.course-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.price-current { font-size: 1.15rem; font-weight: 800; color: var(--text); }
.price-original { font-size: 0.85rem; color: var(--text-4); text-decoration: line-through; }
.price-free { font-size: 1.1rem; font-weight: 800; color: var(--success); }

.btn-enroll {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    background: var(--primary);
    color: white;
    transition: all var(--transition);
}
.btn-enroll:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* =================== CATEGORY CARDS =================== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}
.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    text-align: center;
    transition: all var(--transition-slow);
    cursor: pointer;
    text-decoration: none;
    display: block;
}
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}
.cat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.6rem;
}
.cat-name { font-size: 0.95rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.cat-count { font-size: 0.78rem; color: var(--text-3); }

/* =================== FORMS =================== */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 8px;
}
.form-label.required::after { content: ' *'; color: var(--danger); }
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg-card);
    transition: all var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.form-control.is-invalid { border-color: var(--danger); }
.form-control::placeholder { color: var(--text-4); }
.form-hint { font-size: 0.78rem; color: var(--text-3); margin-top: 6px; }
.form-error { font-size: 0.78rem; color: var(--danger); margin-top: 6px; }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { appearance: none; cursor: pointer; }

.input-group { position: relative; }
.input-group .form-control { padding-right: 48px; }
.input-group .input-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-4);
    cursor: pointer;
}

/* =================== AUTH PAGES =================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 100%);
    padding: 80px 24px;
}
[data-theme="dark"] .auth-page { background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%); }

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 48px;
    width: 100%;
    max-width: 460px;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.4s ease;
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-title { text-align: center; margin-bottom: 8px; font-size: 1.6rem; }
.auth-subtitle { text-align: center; color: var(--text-3); margin-bottom: 32px; font-size: 0.9rem; }
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-4);
    font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.auth-footer { text-align: center; margin-top: 24px; font-size: 0.875rem; color: var(--text-3); }
.auth-footer a { color: var(--primary); font-weight: 600; }

/* =================== ALERTS =================== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}
.alert-success { background: #f0fdf4; border-color: #86efac; color: #166534; }
.alert-danger { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.alert-info { background: #eff6ff; border-color: #93c5fd; color: #1e40af; }
[data-theme="dark"] .alert-success { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3); color: #6ee7b7; }
[data-theme="dark"] .alert-danger { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: #fca5a5; }

/* =================== DASHBOARD =================== */
.dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - var(--nav-height));
    gap: 0;
}
.sidebar {
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 32px 0;
    position: sticky;
    top: var(--nav-height);
    height: calc(100vh - var(--nav-height));
    overflow-y: auto;
}
.sidebar-section { margin-bottom: 8px; }
.sidebar-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-4);
    padding: 8px 24px;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--text-3);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
    position: relative;
}
.sidebar-link:hover, .sidebar-link.active {
    color: var(--primary);
    background: rgba(99,102,241,0.06);
}
.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}
.sidebar-badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
}
.dashboard-main { padding: 40px; overflow-y: auto; }
.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: 1.8rem; margin-bottom: 4px; }
.page-header p { color: var(--text-3); }

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--text); }
.stat-label { font-size: 0.8rem; color: var(--text-3); margin-top: 4px; }
.stat-change {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 100px;
    margin-top: 8px;
    display: inline-block;
}
.stat-change.up { background: #f0fdf4; color: #166534; }
.stat-change.down { background: #fef2f2; color: #991b1b; }

/* =================== TABLE =================== */
.table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}
.table-title { font-size: 1rem; font-weight: 700; }
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left;
    padding: 14px 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-3);
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td {
    padding: 16px 20px;
    font-size: 0.875rem;
    color: var(--text-2);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-2); }
.table-actions { display: flex; gap: 8px; align-items: center; }

/* =================== PROGRESS =================== */
.progress-bar-wrap { background: var(--bg-3); border-radius: 100px; height: 6px; overflow: hidden; }
.progress-bar {
    height: 100%;
    border-radius: 100px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.6s ease;
}

/* =================== TAGS / BADGES =================== */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.tag-primary { background: rgba(99,102,241,0.12); color: var(--primary); }
.tag-success { background: rgba(16,185,129,0.12); color: #059669; }
.tag-danger { background: rgba(239,68,68,0.12); color: #dc2626; }
.tag-warning { background: rgba(245,158,11,0.12); color: #d97706; }
.tag-secondary { background: var(--bg-3); color: var(--text-3); }

/* =================== PAGINATION =================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
    flex-wrap: wrap;
}
.page-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-3);
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: all var(--transition);
    text-decoration: none;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.page-btn.disabled { opacity: 0.4; pointer-events: none; }

/* =================== VIDEO PLAYER =================== */
.learn-layout { display: grid; grid-template-columns: 1fr 340px; height: calc(100vh - var(--nav-height)); }
.video-area { display: flex; flex-direction: column; overflow: hidden; }
.video-player-wrap { background: #000; flex-shrink: 0; }
.video-player-wrap video { width: 100%; max-height: 60vh; display: block; }
.video-info { padding: 24px; overflow-y: auto; border-top: 1px solid var(--border); }
.lesson-sidebar { background: var(--bg-card); border-left: 1px solid var(--border); overflow-y: auto; }
.sidebar-course-title { padding: 20px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 0.95rem; }

.lesson-section { border-bottom: 1px solid var(--border); }
.section-header-btn {
    width: 100%;
    text-align: left;
    padding: 14px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-2);
    transition: background var(--transition);
    cursor: pointer;
    border: none;
    font-family: inherit;
}
.section-header-btn:hover { background: var(--bg-3); }
.section-lessons { display: none; }
.section-lessons.open { display: block; }

.lesson-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--transition);
    text-decoration: none;
    color: var(--text-2);
}
.lesson-item:hover { background: var(--bg-2); }
.lesson-item.active { background: rgba(99,102,241,0.06); color: var(--primary); }
.lesson-item.completed .lesson-icon { color: var(--success); }
.lesson-icon { flex-shrink: 0; }
.lesson-title { font-size: 0.82rem; font-weight: 500; flex: 1; }
.lesson-duration { font-size: 0.72rem; color: var(--text-4); flex-shrink: 0; }

/* =================== COURSE DETAILS PAGE =================== */
.course-hero {
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    color: white;
    padding: 60px 0;
}
.course-hero-grid { display: grid; grid-template-columns: 1fr 380px; gap: 48px; align-items: start; }
.course-hero-meta { display: flex; flex-wrap: wrap; gap: 16px; margin: 16px 0; }
.course-hero-meta span { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; opacity: 0.85; }
.course-sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    position: sticky;
    top: calc(var(--nav-height) + 20px);
}
.course-preview { position: relative; background: #000; aspect-ratio: 16/9; }
.course-preview img { width: 100%; height: 100%; object-fit: cover; opacity: 0.7; }
.play-btn {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.play-btn-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition);
    cursor: pointer;
    color: var(--primary);
}
.play-btn-circle:hover { transform: scale(1.1); }
.course-sidebar-body { padding: 24px; }
.course-big-price { font-size: 2rem; font-weight: 800; color: var(--text); margin-bottom: 16px; }
.course-includes { margin-top: 20px; }
.course-includes h4 { font-size: 0.9rem; margin-bottom: 12px; }
.include-item { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--text-2); margin-bottom: 10px; }
.include-item svg { color: var(--success); flex-shrink: 0; }

/* =================== TABS =================== */
.tabs { border-bottom: 2px solid var(--border); display: flex; gap: 0; overflow-x: auto; }
.tab-btn {
    padding: 14px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-3);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    cursor: pointer;
    font-family: inherit;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { padding: 32px 0; display: none; }
.tab-content.active { display: block; }

/* =================== REVIEW STARS =================== */
.rating-display { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.rating-big { font-size: 3.5rem; font-weight: 800; color: var(--text); line-height: 1; }
.rating-breakdown { flex: 1; }
.rating-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.rating-bar-wrap { flex: 1; height: 6px; background: var(--bg-3); border-radius: 100px; overflow: hidden; }
.rating-bar-fill { height: 100%; background: var(--accent); border-radius: 100px; }
.rating-num { font-size: 0.78rem; color: var(--text-3); min-width: 20px; text-align: right; }

/* =================== MODAL =================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95);
    transition: transform var(--transition);
    overflow: hidden;
}
.modal-overlay.show .modal { transform: scale(1); }
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    transition: all var(--transition);
}
.modal-close:hover { background: var(--bg-2); color: var(--danger); }
.modal-body { padding: 28px; }
.modal-footer { padding: 20px 28px; border-top: 1px solid var(--border); display: flex; gap: 12px; justify-content: flex-end; }

/* =================== TOAST =================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}
.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-xl);
    font-size: 0.875rem;
    pointer-events: all;
    animation: slideInRight 0.3s ease;
    max-width: 380px;
    color: var(--text-2);
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--primary); }

/* =================== FOOTER =================== */
.footer { background: var(--bg-2); border-top: 1px solid var(--border); }
.footer-main { padding: 64px 0; }
.footer-grid {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
}
.footer-brand .nav-brand { margin-bottom: 16px; }
.footer-tagline { color: var(--text-3); font-size: 0.875rem; line-height: 1.7; max-width: 300px; margin-bottom: 24px; }
.social-links { display: flex; gap: 12px; }
.social-link {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    transition: all var(--transition);
}
.social-link:hover { border-color: var(--primary); color: var(--primary); background: rgba(99,102,241,0.08); }
.footer-col h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 20px; }
.footer-col ul li { margin-bottom: 12px; }
.footer-col ul li a { font-size: 0.875rem; color: var(--text-3); transition: color var(--transition); }
.footer-col ul li a:hover { color: var(--primary); }
.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 20px 24px;
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.footer-bottom p { font-size: 0.8rem; color: var(--text-3); }
.badge-secure {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-3);
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 100px;
}

/* =================== ANIMATIONS =================== */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(0.85); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.animate-in { animation: fadeInUp 0.5s ease both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* =================== UTILITIES =================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-3); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; }
.flex { display: flex; } .flex-col { flex-direction: column; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.loading { animation: spin 1s linear infinite; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Empty state */
.empty-state { text-align: center; padding: 80px 24px; }
.empty-icon { margin: 0 auto 20px; color: var(--text-4); }
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { color: var(--text-3); max-width: 360px; margin: 0 auto 24px; }

/* Skeleton loader */
.skeleton { background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* =================== RESPONSIVE =================== */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .footer-brand { grid-column: 1 / -1; }
    .dashboard-layout { grid-template-columns: 220px 1fr; }
    .course-hero-grid { grid-template-columns: 1fr; }
    .course-sidebar-card { position: static; max-width: 420px; }
    .learn-layout { grid-template-columns: 1fr 300px; }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 20px 24px;
        gap: 4px;
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition);
        box-shadow: var(--shadow-lg);
        z-index: 999;
    }
    .nav-menu.show {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    .nav-link { padding: 12px 16px; border-radius: var(--radius-sm); }
    .hamburger { display: flex; }
    .btn-ghost.btn-sm { display: none; }

    .hero-content { grid-template-columns: 1fr; gap: 40px; }
    .hero-visual { display: none; }
    .hero-stats { gap: 20px; }
    .hero { padding: 60px 0 70px; }

    .dashboard-layout { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .dashboard-main { padding: 24px; }

    .learn-layout { grid-template-columns: 1fr; height: auto; }
    .lesson-sidebar { border-left: none; border-top: 1px solid var(--border); height: 400px; }

    .auth-card { padding: 32px 24px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .table-wrap { overflow-x: auto; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .categories-grid { grid-template-columns: repeat(2, 1fr); }
    .courses-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; justify-content: center; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .categories-grid { grid-template-columns: 1fr 1fr; }
    .auth-card { padding: 24px 20px; border-radius: var(--radius-lg); }
    .toast-container { left: 16px; right: 16px; bottom: 16px; }
    .toast { max-width: 100%; }
}


@media (max-width: 768px) {
    /* 1. Navbar ke andar ki spacing kam karni hai */
    .nav-container {
        gap: 10px !important;
        padding: 0 16px !important;
        justify-content: space-between;
    }

    /* 2. Logo aur text ke beech ka gap thoda kam karein */
    .nav-brand {
        gap: 6px !important;
    }
    .brand-name {
        font-size: 1.1rem !important; 
    }

    /* 3. Action icons (Search, Theme) ki spacing kam karein */
    .nav-actions {
        gap: 4px !important;
    }

    /* 4. "Get Started" aur "Login" button mobile pe hide karein taaki 3-dots ko jagah mile */
    .nav-actions .btn-sm {
        display: none !important;
    }

    /* 5. Mobile par padding thodi tight rakhein taaki text screen se bahar na bhage */
    .container, .hero-content {
        padding: 0 16px !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }
}

/* Print */
@media print {
    .navbar, .footer, .sidebar { display: none; }
    .dashboard-main { padding: 0; }
}
/* ===================================================
   ULTIMATE MOBILE OVERFLOW FIX
=================================================== */

/* 1. Kisi bhi cheez ko screen se bahar aane se roko */
html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
}

/* 2. Padding/Border se width na badhe */
*, *::before, *::after {
    box-sizing: border-box !important;
}

@media (max-width: 768px) {
    /* 3. Courses page ke Sidebar aur Content ko ek ke niche ek lao */
    /* Agar tumne HTML mein style="display:grid; grid-template-columns:..." lagaya hai, toh yeh usko fix karega */
    div[style*="grid-template-columns"], 
    div[style*="display: grid"],
    div[style*="display:grid"] {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 20px !important;
    }

    /* 4. Content boxes aur forms ko mobile width ke barabar karo */
    .container, 
    .hero-content, 
    .table-wrap, 
    .auth-card, 
    form,
    .dashboard-main {
        padding-left: 15px !important;
        padding-right: 15px !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    /* 5. Agar koi text ya lamba link screen se bahar ja raha ho */
    p, h1, h2, h3, h4, h5, h6, a, span {
        word-wrap: break-word !important;
        max-width: 100% !important;
    }
}