/* ============================================
   ITVidyarthi — Front-Facing Design System
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- Design Tokens --- */
:root {
    --bg-primary: #030712;
    --bg-secondary: #071427;
    --bg-card: rgba(15, 23, 42, 0.65);
    --bg-card-hover: rgba(25, 40, 70, 0.75);
    --bg-nav: rgba(3, 7, 18, 0.85);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent: #2563eb;
    --accent-light: #3b82f6;
    --accent-glow: rgba(37, 99, 235, 0.35);
    --accent-subtle: rgba(37, 99, 235, 0.08);

    --cyan: #06b6d4;
    --purple: #8b5cf6;
    --emerald: #10b981;

    --border: rgba(148, 163, 184, 0.1);
    --border-hover: rgba(37, 99, 235, 0.4);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 40px var(--accent-glow);

    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    --nav-height: 72px;
    --max-width: 1200px;
}

/* --- Light Mode Design Tokens --- */
:root.light-theme {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-nav: rgba(248, 250, 252, 0.85);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --accent: #2563eb;
    --accent-light: #1d4ed8;
    --accent-glow: rgba(37, 99, 235, 0.15);
    --accent-subtle: rgba(37, 99, 235, 0.04);

    --border: rgba(15, 23, 42, 0.08);
    --border-hover: rgba(37, 99, 235, 0.25);

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.08);
    --shadow-glow: 0 0 40px rgba(37, 99, 235, 0.15);
}

:root.light-theme .category-link {
    background: rgba(255, 255, 255, 0.6);
}

:root.light-theme .category-link.active {
    color: #fff !important;
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    box-shadow: var(--shadow-glow) !important;
}

:root.light-theme .text-gradient {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 50%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

:root.light-theme .skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, rgba(200, 220, 240, 0.5) 50%, var(--bg-card) 75%);
}

:root.light-theme .markdown-body h1,
:root.light-theme .markdown-body h2,
:root.light-theme .markdown-body h3,
:root.light-theme .markdown-body h4,
:root.light-theme .markdown-body h5,
:root.light-theme .markdown-body h6 {
    color: var(--text-primary) !important;
}

:root.light-theme .markdown-body pre {
    background-color: rgba(0, 0, 0, 0.03) !important;
}

:root.light-theme .markdown-body table th {
    background-color: rgba(0, 0, 0, 0.05) !important;
}

:root.light-theme .nav-logo img,
:root.light-theme .footer-brand img {
    filter: invert(1) hue-rotate(180deg) drop-shadow(0 0 8px var(--accent-glow));
}

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* --- Layout --- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 100px 0;
    position: relative;
}

/* --- Navigation --- */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: var(--transition);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
}

.nav-logo img {
    height: 38px;
    width: auto;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

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

.nav-link {
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: var(--accent-subtle);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 20px; height: 2px;
    background: var(--accent);
    border-radius: 1px;
}

/* Dropdown Menu Styles */
.nav-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.nav-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.dropdown-chevron {
    transition: transform 0.25s ease;
}

.nav-dropdown-wrapper:hover .dropdown-chevron,
.nav-dropdown-wrapper.open .dropdown-chevron {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    min-width: 240px;
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 6px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4), var(--shadow-glow);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1100;
}

.nav-dropdown-wrapper:hover .nav-dropdown-menu,
.nav-dropdown-wrapper.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: var(--accent-subtle);
    color: var(--text-primary);
    transform: translateX(3px);
}

.dropdown-item.active {
    background: rgba(139, 92, 246, 0.15);
    color: var(--cyan);
}

.dropdown-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: var(--accent-light);
    flex-shrink: 0;
    transition: var(--transition);
}

.dropdown-item:hover .dropdown-icon {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.dropdown-text {
    display: flex;
    flex-direction: column;
}

.dropdown-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.dropdown-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.2;
}

/* Signed-in User Badge in Navbar */
.nav-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
    max-width: 140px;
}

.nav-user-badge:hover,
.nav-user-badge.active {
    background: rgba(139, 92, 246, 0.22);
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
    color: #fff;
}

.user-avatar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    color: #fff;
    flex-shrink: 0;
}

.user-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sign Out Button in Navbar */
.sign-out-btn {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.25) !important;
    padding: 6px 16px !important;
    font-size: 0.85rem !important;
    border-radius: var(--radius-sm) !important;
    margin-left: 4px !important;
}

.sign-out-btn:hover {
    background: rgba(239, 68, 68, 0.85) !important;
    color: #fff !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4) !important;
}

.nav-cta {
    padding: 7px 18px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    transition: var(--transition);
    margin-left: 6px;
    white-space: nowrap;
}
.nav-cta:hover {
    background: var(--accent-light);
    box-shadow: var(--shadow-glow);
}

/* Hamburger */
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
}
.nav-hamburger span {
    display: block;
    width: 24px; height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: var(--transition);
}

/* Mobile Nav Drawer (Breaks at 992px for optimal spacing) */
@media (max-width: 992px) {
    .container {
        padding: 0 16px;
    }
    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0; right: 0;
        background: var(--bg-nav);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        flex-direction: column;
        align-items: stretch;
        padding: 20px 24px;
        border-bottom: 1px solid var(--border);
        transform: translateY(-120%);
        transition: var(--transition);
        opacity: 0;
        max-height: calc(100vh - var(--nav-height));
        overflow-y: auto;
        gap: 10px;
    }
    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
    }
    .nav-hamburger { display: flex; }
    .nav-cta { margin-left: 0; width: 100%; text-align: center; }
    .nav-user-badge { max-width: 100%; width: 100%; justify-content: center; }

    /* Dropdown in Mobile Drawer */
    .nav-dropdown-wrapper {
        width: 100%;
    }
    .nav-dropdown-trigger {
        width: 100%;
        justify-content: space-between;
    }
    .nav-dropdown-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.05);
        margin-top: 6px;
        display: none;
        min-width: 100%;
    }
    .nav-dropdown-wrapper.open .nav-dropdown-menu {
        display: block;
    }
}

.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--accent-subtle);
}

.theme-toggle-btn svg {
    display: block;
}

@media (max-width: 768px) {
    .theme-toggle-btn {
        width: 100%;
        border-radius: var(--radius-sm);
        padding: 8px 18px;
        height: auto;
    }
    .theme-toggle-btn::after {
        content: " Toggle Theme";
        font-size: 0.9rem;
        font-weight: 500;
        margin-left: 8px;
    }
}

/* --- Buttons --- */
.btn-primary {
    display: inline-flex;
    align-items: center; gap: 8px;
    padding: 14px 32px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    border: none;
}
.btn-primary:hover {
    background: var(--accent-light);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-ghost {
    display: inline-flex;
    align-items: center; gap: 8px;
    padding: 14px 32px;
    background: transparent;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: var(--transition);
}
.btn-ghost:hover {
    border-color: var(--accent);
    background: var(--accent-subtle);
    transform: translateY(-2px);
}

/* --- Glass Card --- */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    transition: var(--transition);
}
.glass-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
}

/* --- Section Headings --- */
.section-label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent-light);
    margin-bottom: 12px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.7;
}

.text-gradient {
    background: linear-gradient(135deg, #fff 0%, #93c5fd 50%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Icon Box --- */
.icon-box {
    width: 56px; height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center; justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
    flex-shrink: 0;
}
.icon-box.blue   { background: rgba(37, 99, 235, 0.15); color: var(--accent-light); }
.icon-box.cyan   { background: rgba(6, 182, 212, 0.15); color: var(--cyan); }
.icon-box.purple { background: rgba(139, 92, 246, 0.15); color: var(--purple); }
.icon-box.green  { background: rgba(16, 185, 129, 0.15); color: var(--emerald); }

/* --- Grid --- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

@media (max-width: 1024px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* --- Hero --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: var(--nav-height);
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 50% 0%, var(--accent-glow), transparent),
        radial-gradient(ellipse 40% 30% at 80% 80%, rgba(139, 92, 246, 0.1), transparent),
        radial-gradient(ellipse 40% 30% at 20% 70%, rgba(6, 182, 212, 0.08), transparent);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 0 24px;
}

.hero-logo {
    width: min(400px, 80vw);
    margin: 0 auto 40px;
    filter: drop-shadow(0 0 24px var(--accent-glow));
    animation: heroFloat 6s ease-in-out infinite;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.7;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Stats Row --- */
.stats-row {
    display: flex;
    justify-content: center;
    gap: 60px;
    flex-wrap: wrap;
    padding: 40px 0;
}
.stat-item { text-align: center; }
.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-light);
    line-height: 1;
}
.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Content Cards (Browse Page) --- */
.content-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.content-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-6px);
}
.content-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid var(--border);
}
.content-card-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.content-card-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 12px;
    width: fit-content;
}
.badge-blue   { background: rgba(37, 99, 235, 0.15); color: var(--accent-light); }
.badge-cyan   { background: rgba(6, 182, 212, 0.15); color: var(--cyan); }
.badge-purple { background: rgba(139, 92, 246, 0.15); color: var(--purple); }
.badge-green  { background: rgba(16, 185, 129, 0.15); color: var(--emerald); }

.content-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
}
.content-card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
}
.content-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- Filter Tabs --- */
.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}
.filter-tab {
    padding: 8px 20px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
}
.filter-tab:hover,
.filter-tab.active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

/* --- Search Bar --- */
.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    max-width: 480px;
    width: 100%;
    transition: var(--transition);
}
.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.search-bar input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-icon { color: var(--text-muted); font-size: 1.1rem; flex-shrink: 0; }

/* --- Skeleton Loader --- */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, rgba(30,50,80,0.5) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* --- Footer --- */
.footer {
    padding: 60px 0 30px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-brand img { height: 36px; margin-bottom: 16px; }
.footer-brand p { color: var(--text-secondary); font-size: 0.9rem; max-width: 300px; }
.footer-heading {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
    color: var(--text-primary);
}
.footer-link {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 4px 0;
    transition: var(--transition);
}
.footer-link:hover { color: var(--accent-light); }
.footer-bottom {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}
@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
}

/* --- CTA Section --- */
.cta-section {
    text-align: center;
    padding: 80px 0;
    position: relative;
}
.cta-glow {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 500px; height: 300px;
    background: var(--accent-glow);
    filter: blur(100px);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

/* --- Animations --- */
@keyframes heroFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.stagger > *:nth-child(1) { transition-delay: 0s; }
.stagger > *:nth-child(2) { transition-delay: 0.1s; }
.stagger > *:nth-child(3) { transition-delay: 0.2s; }
.stagger > *:nth-child(4) { transition-delay: 0.3s; }
.stagger > *:nth-child(5) { transition-delay: 0.4s; }
.stagger > *:nth-child(6) { transition-delay: 0.5s; }

/* --- Page Header (Browse/About) --- */
.page-header {
    padding: 140px 0 60px;
    text-align: center;
    position: relative;
}
.page-header-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 50% 60% at 50% 0%, var(--accent-glow), transparent);
    z-index: 0;
    pointer-events: none;
}

/* --- Utility --- */
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-0 { margin-bottom: 0; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-40 { margin-bottom: 40px; }
.mb-60 { margin-bottom: 60px; }
.mt-80 { margin-top: 80px; }
.gap-16 { gap: 16px; }
.relative { position: relative; }
.z-1 { z-index: 1; }

/* --- Category Navigation (Pills) --- */
.category-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 48px;
    width: 100%;
}

.category-link {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.4);
    cursor: pointer;
    transition: var(--transition);
}

.category-link:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--accent-subtle);
    transform: translateY(-1px);
}

.category-link.active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

/* --- Course Card (Subcategories, Modules, etc.) --- */
.course-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.course-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.05), transparent 50%);
    pointer-events: none;
}

.course-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
}

.course-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    line-height: 1.4;
}

.course-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.course-card strong {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.course-card span {
    color: var(--accent-light);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    transition: var(--transition);
}

.course-card:hover span {
    transform: translateX(4px);
}

/* --- User Profile Section --- */
.profile-section {
    padding-top: 40px;
    padding-bottom: 20px;
}

.profile-card {
    display: flex;
    gap: 32px;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.profile-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at bottom right, rgba(139, 92, 246, 0.05), transparent 50%);
    pointer-events: none;
}

.profile-avatar-wrapper {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.profile-info-wrapper {
    flex: 1;
    min-width: 250px;
}

.profile-info-wrapper h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.profile-info-wrapper p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
}

.badge-role {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    flex: 2;
    width: 100%;
}

.profile-stat-box {
    background: rgba(148, 163, 184, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    transition: var(--transition);
}

.profile-stat-box:hover {
    background: rgba(148, 163, 184, 0.08);
    border-color: var(--border-hover);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.profile-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    font-weight: 600;
}

.profile-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-stat-value.active-status {
    color: var(--emerald);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.profile-stat-value.active-status .status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--emerald);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--emerald);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.nav-user-greeting {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 12px;
}

/* Light mode specific adjustments for profile card */
:root.light-theme .profile-stat-box {
    background: rgba(15, 23, 42, 0.03);
}
:root.light-theme .profile-stat-box:hover {
    background: rgba(15, 23, 42, 0.05);
}

/* ── Share Modal & Sharing Buttons ──────────────────────────────── */
.share-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.share-modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}
.share-modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 36px;
    max-width: 440px;
    width: 100%;
    position: relative;
    box-shadow: 0 40px 80px rgba(0,0,0,0.5), 0 0 40px rgba(37,99,235,0.15);
    transform: scale(0.92) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
    opacity: 0;
}
.share-modal-overlay.open .share-modal-box {
    transform: scale(1) translateY(0);
    opacity: 1;
}
.share-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1;
    transition: var(--transition);
}
.share-modal-close:hover {
    background: rgba(239,68,68,0.15);
    border-color: rgba(239,68,68,0.4);
    color: #ef4444;
}
.share-modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 6px;
    text-align: left;
}
.share-modal-course-name {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0 0 20px;
    text-align: left;
    line-height: 1.5;
}
.share-modal-divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}
.share-social-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 8px;
}
.share-social-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 10px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
}
.share-social-btn svg {
    transition: transform 0.3s ease;
}
.share-social-btn:hover svg {
    transform: translateY(-2px);
}
.share-social-btn.linkedin:hover {
    background: rgba(10, 102, 194, 0.15);
    border-color: rgba(10, 102, 194, 0.4);
    color: #0a66c2;
}
.share-social-btn.twitter:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}
:root.light-theme .share-social-btn.twitter:hover {
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.2);
    color: #0f172a;
}
.share-social-btn.whatsapp:hover {
    background: rgba(37, 211, 102, 0.15);
    border-color: rgba(37, 211, 102, 0.4);
    color: #25d366;
}
.share-copy-section {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}
.share-copy-section input {
    flex: 1;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    font-family: inherit;
    text-overflow: ellipsis;
}
:root.light-theme .share-copy-section input {
    background: rgba(15, 23, 42, 0.03);
}
.share-copy-section button {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.share-copy-section button:hover {
    background: var(--accent-light);
    box-shadow: var(--shadow-glow);
}
.share-copy-section button.copied {
    background: var(--emerald) !important;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4) !important;
}
:root.light-theme .share-modal-box {
    background: #ffffff !important;
    background-color: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08) !important;
}

.share-course-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}
.share-course-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}
:root.light-theme .share-course-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

