/* =====================================================================
   THEMES
   Set on <html> or <body>:
     data-theme-mode="light" | "dark"
     data-theme-preset="ocean | lavender | forest | sunset | classic |
                        midnight | ocean_night | purple_night |
                        forest_night | sunset_dark"
   No attributes = original purple light theme.
   Dark themes automatically use light/white text everywhere.
===================================================================== */

/* ===== VARIABLES (default = light) ===== */
:root {
    --primary: #2563eb;
    --primary-dark: color-mix(in srgb, var(--primary) 82%, #000);
    --primary-light: color-mix(in srgb, var(--primary) 12%, var(--surface));
    --on-primary: #ffffff;
    --accent: #f5a623;
    --green: #22c55e;
    --red: #ef4444;

    --text-dark: #1a1a2e;
    --text-mid: #4b5563;
    --text-light: #9ca3af;
    --bg: #f3f8ff;
    --surface: #ffffff;
    --white: var(--surface);
    --border: #e5e7eb;

    --hero-bg: linear-gradient(135deg,#e3edff 0%,#e8f2ff 50%,#f0f6ff 100%);
    --premium-bg: linear-gradient(135deg,#eef4ff,#e3edff);
    --premium-border: #bfd3ff;
    --overlay: rgba(0,0,0,.4);

    --sidebar-w: 210px;
    --right-w: 280px;
    --nav-h: 64px;
    --r: 12px;
    --shadow: 0 2px 16px rgba(37,99,235,0.08);
    --card-shadow: 0 4px 24px rgba(0,0,0,0.08);
    --menu-shadow: 0 20px 60px rgba(0,0,0,0.14);
}

/* ----- Light presets ----- */
:is(html,body)[data-theme-preset="ocean"]    { --primary:#2563eb; --bg:#f3f8ff; }
:is(html,body)[data-theme-preset="lavender"] { --primary:#7c3aed; --bg:#fcf9ff; }
:is(html,body)[data-theme-preset="forest"]   { --primary:#15803d; --bg:#f5fcf6; }
:is(html,body)[data-theme-preset="sunset"]   { --primary:#c2410c; --bg:#fffaf6; }
:is(html,body)[data-theme-preset="classic"]  { --primary:#475569; --bg:#f8fafc; }

/* Light presets always use dark readable text */
:is(html, body)[data-theme-preset="ocean"],
:is(html, body)[data-theme-preset="lavender"],
:is(html, body)[data-theme-preset="forest"],
:is(html, body)[data-theme-preset="sunset"],
:is(html, body)[data-theme-preset="classic"] {
    color-scheme: light;
    --text-dark: #1a1a1a;
    --text-mid: #4b5563;
    --text-light: #6b7280;
    --on-primary: #ffffff;
    --border: #e5e7eb;
}

/* ----- Dark (generic) ----- */
:is(html,body)[data-theme-mode="dark"] {
    color-scheme: dark;
    --primary: #60a5fa;
    --on-primary: #0b1120;
    --primary-light: color-mix(in srgb, var(--primary) 20%, var(--surface));

    --text-dark: #f8fafc;
    --text-mid: #cbd5e1;
    --text-light: #94a3b8;
    --bg: #0b1120;
    --surface: #111827;
    --border: rgba(255,255,255,.14);

    --hero-bg: linear-gradient(135deg,#16213a 0%,#111a30 50%,#0e1628 100%);
    --premium-bg: linear-gradient(135deg,#1a2238,#141b2e);
    --premium-border: rgba(255,255,255,.14);
    --overlay: rgba(0,0,0,.65);

    --shadow: 0 2px 16px rgba(0,0,0,.4);
    --card-shadow: 0 6px 28px rgba(0,0,0,.5);
    --menu-shadow: 0 20px 60px rgba(0,0,0,.6);
}

/* ----- Dark presets (must come after the generic dark block) ----- */

/* ----- Dark presets: readable light text for every dark preset ----- */
:is(html, body)[data-theme-preset="midnight"],
:is(html, body)[data-theme-preset="ocean_night"],
:is(html, body)[data-theme-preset="purple_night"],
:is(html, body)[data-theme-preset="forest_night"],
:is(html, body)[data-theme-preset="sunset_dark"] {
    color-scheme: dark;
    --text-dark: #f8fafc;
    --text-mid: #cbd5e1;
    --text-light: #94a3b8;
    --border: rgba(255, 255, 255, 0.14);
}

/* Midnight Dark */
:is(html, body)[data-theme-preset="midnight"] {
    --primary: #60a5fa;
    --bg: #0b1120;
    --surface: #111827;
}

/* Ocean Night */
:is(html, body)[data-theme-preset="ocean_night"] {
    --primary: #38bdf8;
    --bg: #071523;
    --surface: #0f263f;
}

/* Purple Night */
:is(html, body)[data-theme-preset="purple_night"] {
    --primary: #c084fc;
    --bg: #100a1e;
    --surface: #27133d;
}

/* Forest Night */
:is(html, body)[data-theme-preset="forest_night"] {
    --primary: #4ade80;
    --bg: #071a14;
    --surface: #102d25;
}

/* Sunset Dark */
:is(html, body)[data-theme-preset="sunset_dark"] {
    --primary: #fb923c;
    --bg: #170d0b;
    --surface: #3b1f1a;
}

/* ===== BASE ===== */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{font-family:'DM Sans',sans-serif;background:var(--bg);color:var(--text-dark);font-size:14px;transition:background-color .2s,color .2s}
a{text-decoration:none;color:inherit}
ul{list-style:none}
img{max-width:100%;display:block}

/* ===== NAVBAR ===== */
.navbar{position:sticky;top:0;z-index:100;height:var(--nav-h);background:var(--surface);border-bottom:1px solid var(--border);display:flex;align-items:center;padding:0 20px;gap:14px;box-shadow:0 2px 8px rgba(0,0,0,0.04)}


.navbar-left

{display:flex;align-items:center;gap:12px;flex-shrink:0}
.navbar-center{flex:1;max-width:500px;margin:0 auto}
.navbar-right{display:flex;align-items:center;gap:8px;flex-shrink:0;margin-left:auto}
.logo{display:flex;align-items:center;gap:8px}
.logo-text{font-family:'Outfit',sans-serif;font-weight:800;font-size:20px;color:var(--text-dark);letter-spacing:-0.5px}
.hamburger{display:none;flex-direction:column;gap:5px;cursor:pointer;background:none;border:none;padding:4px}
.hamburger span{display:block;width:22px;height:2px;background:var(--text-dark);border-radius:2px;transition:all .3s}
/* Hamburger → X */
.hamburger.is-open span:nth-child(1){transform:translateY(7px) rotate(45deg)}
.hamburger.is-open span:nth-child(2){opacity:0;transform:scaleX(0)}
.hamburger.is-open span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}

/* ── CATEGORIES MEGA MENU ── */
.nav-categories-wrap { position: relative; z-index: 300; }
.categories-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    padding: 7px 12px;
    border-radius: 8px;
    transition: background .2s, color .2s;
    white-space: nowrap;
}
.categories-btn:hover,
.nav-categories-wrap.open .categories-btn {
    background: var(--primary-light);
    color: var(--primary);
}
.cat-arrow { font-size: 10px; transition: transform .25s; flex-shrink: 0; }
.nav-categories-wrap.open .cat-arrow { transform: rotate(180deg); }

/* Mega menu — hidden by default, shown when .open */
.mega-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: var(--surface);
    color: var(--text-dark);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--menu-shadow);
    width: 620px;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity .2s, transform .2s;
}
.nav-categories-wrap.open .mega-menu {
    display: grid;
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}
.mega-col { display: flex; flex-direction: column; gap: 2px; }
.mega-heading {
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: var(--text-light);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1.5px solid var(--border);
}
.mega-col a {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--text-mid);
    padding: 6px 8px;
    border-radius: 8px;
    font-weight: 500;
    transition: all .15s;
}
.mega-col a:hover { background: var(--primary-light); color: var(--primary); padding-left: 12px; }
.mega-col:nth-child(1) a::before { content: '💻'; font-size: 12px; }
.mega-col:nth-child(2) a::before { content: '🤖'; font-size: 12px; }
.mega-col:nth-child(3) a::before { content: '🎨'; font-size: 12px; }
.mega-col:nth-child(4) a::before { content: '🛠'; font-size: 12px; }

.search-bar{position:relative;width:100%}
.search-bar input{width:100%;padding:10px 16px 10px 40px;border:1.5px solid var(--border);border-radius:24px;font-family:'DM Sans',sans-serif;font-size:13px;background:var(--bg);color:var(--text-dark);outline:none;transition:border-color .2s,box-shadow .2s}
.search-bar input::placeholder{color:var(--text-light)}
.search-bar input:focus{border-color:var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 18%,transparent);background:var(--surface)}
.search-icon{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:var(--text-light);font-size:13px}

.become-instructor{font-size:13px;font-weight:500;color:var(--text-mid);white-space:nowrap;transition:color .2s}
.become-instructor:hover{color:var(--primary)}
.nav-icon-btn{position:relative;width:36px;height:36px;display:flex;align-items:center;justify-content:center;border-radius:8px;color:var(--text-mid);transition:background .2s;font-size:15px}
.nav-icon-btn:hover{background:var(--primary-light);color:var(--primary)}
.badge{position:absolute;top:4px;right:4px;background:var(--primary);color:var(--on-primary);font-size:9px;font-weight:700;width:16px;height:16px;border-radius:50%;display:flex;align-items:center;justify-content:center;border:2px solid var(--surface)}
.btn-login{padding:8px 16px;font-size:13px;font-weight:600;color:var(--text-dark);border-radius:8px;transition:background .2s}
.btn-login:hover{background:var(--bg)}
.btn-signup{padding:8px 18px;font-size:13px;font-weight:600;background:var(--primary);color:var(--on-primary);border-radius:8px;transition:all .2s}
.btn-signup:hover{background:var(--primary-dark);transform:translateY(-1px)}
.mobile-search{display:none;padding:10px 16px;background:var(--surface);border-bottom:1px solid var(--border)}

/* ===== APP BODY ===== */
.app-body{display:flex;min-height:calc(100vh - var(--nav-h))}

/* ===== SIDEBAR ===== */
.sidebar{width:var(--sidebar-w);flex-shrink:0;background:var(--surface);color:var(--text-mid);border-right:1px solid var(--border);position:sticky;top:var(--nav-h);height:calc(100vh - var(--nav-h));overflow-y:auto;overflow-x:hidden;transition:transform .3s}
.sidebar::-webkit-scrollbar{width:3px}
.sidebar::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}
.sidebar-overlay{display:none}
.sidebar-nav{padding:12px 0 20px}
.sidebar-nav ul{display:flex;flex-direction:column}
.sidebar-nav ul li a{display:flex;align-items:center;gap:9px;padding:9px 18px;color:var(--text-mid);font-size:13px;font-weight:500;transition:all .2s;position:relative}
.sidebar-nav ul li a i{width:16px;text-align:center;font-size:13px;flex-shrink:0}
.sidebar-nav ul li a:hover{background:var(--primary-light);color:var(--primary)}
.sidebar-nav ul li.active a{background:var(--primary-light);color:var(--primary);font-weight:600}
.sidebar-nav ul li.active a::before{content:'';position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--primary);border-radius:0 4px 4px 0}
.sidebar-group{margin-top:6px}
.sidebar-group-title{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:0.8px;color:var(--text-light);padding:10px 18px 4px}
.premium-card{margin:16px 12px;padding:16px;background:var(--premium-bg);border-radius:var(--r);border:1px solid var(--premium-border);text-align:center}
.premium-icon{font-size:22px;margin-bottom:6px}
.premium-title{font-family:'Outfit',sans-serif;font-weight:700;font-size:14px;color:var(--text-dark);margin-bottom:4px}
.premium-card p{font-size:11.5px;color:var(--text-mid);margin-bottom:12px;line-height:1.5}
.btn-premium{display:block;padding:8px;background:var(--primary);color:var(--on-primary);border-radius:8px;font-size:13px;font-weight:600;transition:background .2s}
.btn-premium:hover{background:var(--primary-dark)}

/* ===== MAIN ===== */
.main-content{flex:1;min-width:0;padding:24px;overflow:hidden}

/* ===== HERO ===== */
.hero-banner{background:var(--hero-bg);border-radius:20px;padding:40px 40px 0;position:relative;overflow:hidden;margin-bottom:28px;min-height:220px;display:flex;align-items:flex-end}
.hero-banner::before{content:'';position:absolute;top:-40px;right:180px;width:200px;height:200px;background:radial-gradient(circle,color-mix(in srgb,var(--primary) 18%,transparent) 0%,transparent 70%);border-radius:50%}
.hero-content{flex:1;padding-bottom:36px;z-index:1}
.hero-content h1{font-family:'Outfit',sans-serif;font-size:36px;font-weight:800;line-height:1.1;color:var(--text-dark);margin-bottom:4px}
.hero-content h1 span{color:var(--primary)}
.hero-content p{font-size:14px;color:var(--text-mid);margin:12px 0 24px;max-width:380px;line-height:1.6}
.hero-actions{display:flex;gap:12px;flex-wrap:wrap}
.btn-explore{padding:12px 24px;background:var(--primary);color:var(--on-primary);border-radius:10px;font-weight:600;font-size:14px;transition:all .2s}
.btn-explore:hover{background:var(--primary-dark);transform:translateY(-2px);box-shadow:0 6px 20px color-mix(in srgb,var(--primary) 35%,transparent)}
.btn-watch{padding:12px 20px;background:var(--surface);color:var(--text-dark);border-radius:10px;font-weight:600;font-size:14px;display:flex;align-items:center;gap:8px;transition:all .2s;box-shadow:0 2px 8px rgba(0,0,0,.08)}
.btn-watch:hover{box-shadow:0 4px 16px rgba(0,0,0,.12);transform:translateY(-2px)}
.play-icon{width:24px;height:24px;background:var(--primary);border-radius:50%;display:flex;align-items:center;justify-content:center}
.play-icon i{font-size:8px;color:var(--on-primary);margin-left:2px}
.hero-visual{position:absolute;right:30px;bottom:0;height:200px;display:flex;align-items:flex-end;gap:16px}
.hero-progress-card{background:var(--surface);border-radius:12px;padding:12px 16px;box-shadow:0 8px 24px rgba(0,0,0,.1);margin-bottom:40px;min-width:160px}
.hero-progress-card .prog-label{font-size:12px;color:var(--text-mid);margin-bottom:6px}
.hero-progress-card .prog-value{font-size:18px;font-weight:700;color:var(--primary);margin-bottom:8px}
.prog-bar{height:6px;background:var(--primary-light);border-radius:3px;overflow:hidden}
.prog-fill{height:100%;background:var(--primary);border-radius:3px}
.hero-code-badge{background:var(--surface);border-radius:12px;width:52px;height:52px;display:flex;align-items:center;justify-content:center;box-shadow:0 8px 24px rgba(0,0,0,.1);margin-bottom:80px;font-weight:700;font-size:13px;color:var(--primary)}

/* ===== CATEGORIES STRIP ===== */
.categories-strip{display:flex;gap:10px;margin-bottom:28px;overflow-x:auto;padding-bottom:4px;scroll-snap-type:x mandatory}
.categories-strip::-webkit-scrollbar{height:3px}
.categories-strip::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}
.category-chip{display:flex;align-items:center;gap:9px;background:var(--surface);border-radius:10px;padding:9px 14px;flex-shrink:0;scroll-snap-align:start;border:1.5px solid var(--border);transition:all .2s;cursor:pointer;min-width:145px}
.category-chip:hover{border-color:var(--primary);box-shadow:0 4px 16px color-mix(in srgb,var(--primary) 18%,transparent);transform:translateY(-2px)}
.cat-icon{width:36px;height:36px;border-radius:9px;display:flex;align-items:center;justify-content:center;font-size:17px;flex-shrink:0}
.cat-text .cat-name{font-weight:600;font-size:12.5px;color:var(--text-dark)}
.cat-text .cat-count{font-size:11px;color:var(--text-light);margin-top:1px}

/* ===== SECTION HEADER ===== */
.section-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}
.section-header h2{font-family:'Outfit',sans-serif;font-size:19px;font-weight:700;display:flex;align-items:center;gap:10px;color:var(--text-dark)}
.section-tag{padding:3px 9px;border-radius:20px;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.5px}
.tag-popular{background:#22c55e;color:#fff}
.tag-guided{background:var(--primary);color:var(--on-primary)}
.tag-new{background:#f5a623;color:#fff}
.tag-trending{background:#ef4444;color:#fff}
.view-all{font-size:13px;font-weight:600;color:var(--primary);transition:opacity .2s}
.view-all:hover{opacity:.7}

/* ===== COURSE CARDS ===== */
.courses-row{display:grid;grid-template-columns:repeat(auto-fill,minmax(195px,1fr));gap:14px;margin-bottom:28px}
.course-card{background:var(--surface);border-radius:var(--r);overflow:hidden;border:1px solid var(--border);transition:all .25s;cursor:pointer;position:relative}
.course-card:hover{transform:translateY(-4px);box-shadow:var(--card-shadow);border-color:transparent}
.course-thumb{position:relative;height:125px;overflow:hidden;display:flex;align-items:center;justify-content:center;font-size:44px}
.course-badge{position:absolute;top:8px;left:8px;padding:3px 8px;border-radius:5px;font-size:10px;font-weight:700;text-transform:uppercase}
.badge-bestseller{background:var(--accent);color:#fff}
.badge-new{background:var(--green);color:#fff}
.badge-hot{background:var(--red);color:#fff}
.course-body{padding:12px}
.course-title{font-weight:600;font-size:12.5px;line-height:1.4;margin-bottom:2px;color:var(--text-dark)}
.course-subtitle{font-size:11px;color:var(--text-light);margin-bottom:7px}
.course-instructor{display:flex;align-items:center;gap:5px;margin-bottom:7px}
.instructor-avatar{width:20px;height:20px;border-radius:50%;background:var(--primary-light);display:flex;align-items:center;justify-content:center;font-size:9px;color:var(--primary);font-weight:700;flex-shrink:0}
.instructor-name{font-size:11px;color:var(--text-mid)}
.course-meta{display:flex;align-items:center;justify-content:space-between}
.course-rating{display:flex;align-items:center;gap:3px;font-size:11.5px;color:var(--text-dark)}
.stars{color:var(--accent);font-size:10.5px}
.count{color:var(--text-light);font-size:10px}
.price-current{font-weight:700;font-size:12.5px;color:var(--text-dark)}
.price-original{font-size:10.5px;color:var(--text-light);text-decoration:line-through;margin-left:3px}
.course-tags{margin-top:7px;display:flex;gap:4px;flex-wrap:wrap}
.course-tag{padding:2px 7px;background:var(--bg);border-radius:10px;font-size:10px;color:var(--text-mid);font-weight:500}

/* ===== TRENDING TUTORIALS GRID ===== */
.tutorials-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;margin-bottom:28px}
.tutorial-card{background:var(--surface);border:1.5px solid var(--border);border-radius:12px;padding:14px 12px;display:flex;align-items:center;gap:10px;cursor:pointer;transition:all .2s;position:relative}
.tutorial-card:hover{border-color:var(--primary);box-shadow:0 4px 16px color-mix(in srgb,var(--primary) 18%,transparent);transform:translateY(-2px)}
.tutorial-card.active{border-color:var(--primary);box-shadow:0 0 0 2px color-mix(in srgb,var(--primary) 22%,transparent)}
.tut-rank{position:absolute;top:6px;right:8px;font-size:10px;font-weight:700;color:var(--text-light)}
.tut-icon{width:38px;height:38px;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:24px}
.tut-icon img{width:32px;height:32px;object-fit:contain}
.tut-info .tut-name{font-weight:700;font-size:13px;color:var(--text-dark);line-height:1.2}
.tut-info .tut-cat{font-size:11px;color:var(--text-mid);margin-top:2px}

/* ===== LEARNING PATHS ===== */
.paths-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px;margin-bottom:28px}
.path-card{background:var(--surface);border-radius:14px;padding:20px;border:1px solid var(--border);transition:all .2s;cursor:pointer;position:relative;overflow:hidden}
.path-card::before{content:'';position:absolute;top:0;left:0;right:0;height:4px;border-radius:14px 14px 0 0}
.path-card:hover{transform:translateY(-3px);box-shadow:var(--card-shadow)}
.path-card.purple::before{background:linear-gradient(90deg,#6C3EF5,#9b59b6)}
.path-card.blue::before{background:linear-gradient(90deg,#3b82f6,#06b6d4)}
.path-card.green::before{background:linear-gradient(90deg,#22c55e,#10b981)}
.path-card.orange::before{background:linear-gradient(90deg,#f59e0b,#ef4444)}
.path-card.pink::before{background:linear-gradient(90deg,#ec4899,#8b5cf6)}
.path-card.teal::before{background:linear-gradient(90deg,#14b8a6,#3b82f6)}
.path-icon{font-size:32px;margin-bottom:10px}
.path-title{font-family:'Outfit',sans-serif;font-size:15px;font-weight:700;margin-bottom:5px;color:var(--text-dark)}
.path-desc{font-size:12px;color:var(--text-mid);line-height:1.6;margin-bottom:12px}
.path-meta{display:flex;gap:12px;font-size:11.5px;color:var(--text-light)}
.path-meta span{display:flex;align-items:center;gap:4px}
.path-badge{position:absolute;top:16px;right:16px;padding:3px 8px;background:var(--primary-light);color:var(--primary);border-radius:8px;font-size:10px;font-weight:700}

/* ===== DESIGN SHOWCASE ===== */
.design-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:16px;margin-bottom:28px}
.design-card{background:var(--surface);border-radius:14px;overflow:hidden;border:1px solid var(--border);transition:all .25s;cursor:pointer}
.design-card:hover{transform:translateY(-4px);box-shadow:var(--card-shadow)}
.design-thumb{height:140px;display:flex;align-items:center;justify-content:center;font-size:52px;position:relative}
.design-thumb .tool-badge{position:absolute;bottom:8px;right:8px;padding:3px 8px;border-radius:6px;font-size:10px;font-weight:700;color:#fff}
.design-body{padding:14px;color:var(--text-dark)}

/* ===== AI TOOLS SECTION ===== */
.ai-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:14px;margin-bottom:28px}
.ai-card{background:var(--surface);border-radius:12px;padding:16px;border:1px solid var(--border);transition:all .2s;cursor:pointer;display:flex;align-items:flex-start;gap:12px}
.ai-card:hover{border-color:var(--primary);box-shadow:0 4px 16px color-mix(in srgb,var(--primary) 16%,transparent);transform:translateY(-2px)}
.ai-icon{width:44px;height:44px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:22px;flex-shrink:0}
.ai-info .ai-name{font-weight:700;font-size:13.5px;margin-bottom:3px;color:var(--text-dark)}
.ai-info .ai-desc{font-size:11.5px;color:var(--text-mid);line-height:1.4}
.ai-info .ai-count{font-size:11px;color:var(--primary);font-weight:600;margin-top:4px}

/* ===== LEARN YOUR WAY + WHY ===== */
.learn-why{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-bottom:28px}
.learn-way-card{background:linear-gradient(135deg,#2d1b69,#1a0e4e);border-radius:16px;padding:28px;color:#fff;position:relative;overflow:hidden;display:flex;flex-direction:column;justify-content:space-between;min-height:180px}
.learn-way-card::before{content:'';position:absolute;right:-20px;bottom:-20px;width:160px;height:160px;background:rgba(255,255,255,.05);border-radius:50%}
.learn-way-card h3{font-family:'Outfit',sans-serif;font-size:22px;font-weight:700;margin-bottom:8px;color:#c8b4ff}
.learn-way-card p{font-size:13px;opacity:.75;line-height:1.6;margin-bottom:16px}
.learn-way-actions{display:flex;gap:10px;flex-wrap:wrap}
.btn-mode{padding:8px 16px;border-radius:8px;font-size:12.5px;font-weight:600;display:flex;align-items:center;gap:6px;transition:all .2s;cursor:pointer}
.btn-mode-primary{background:#fff;color:#5428e0}
.btn-mode-secondary{background:rgba(255,255,255,.12);color:#fff;border:1px solid rgba(255,255,255,.2)}
.why-section{background:var(--surface);border-radius:16px;padding:24px;border:1px solid var(--border)}
.why-section h3{font-family:'Outfit',sans-serif;font-size:17px;font-weight:700;margin-bottom:18px;color:var(--text-dark)}
.why-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.why-item{text-align:center}
.why-icon{font-size:26px;margin-bottom:7px}
.why-item h4{font-size:12.5px;font-weight:600;margin-bottom:3px;color:var(--text-dark)}
.why-item p{font-size:11px;color:var(--text-mid);line-height:1.5}

/* ===== TRUSTED ===== */
.trusted-section{text-align:center;padding:20px 0;border-top:1px solid var(--border);margin-top:8px}
.trusted-section p{font-size:12px;color:var(--text-light);margin-bottom:14px}
.brand-logos{display:flex;align-items:center;justify-content:center;gap:28px;flex-wrap:wrap}
.brand-logo{font-size:14px;font-weight:700;color:var(--text-light);opacity:.6;transition:opacity .2s}
.brand-logo:hover{opacity:1}

/* ===== RIGHT PANEL ===== */
.right-panel{width:var(--right-w);flex-shrink:0;padding:24px 16px 24px 0;display:flex;flex-direction:column;gap:22px;color:var(--text-dark)}
.panel-section h3{font-family:'Outfit',sans-serif;font-size:14.5px;font-weight:700;margin-bottom:12px;display:flex;align-items:center;justify-content:space-between;color:var(--text-dark)}
.panel-section h3 a{font-size:12px;font-weight:500;color:var(--primary)}
.continue-item{display:flex;gap:10px;padding:9px 0;border-bottom:1px solid var(--border)}
.continue-item:last-child{border-bottom:none}
.continue-thumb{width:58px;height:42px;border-radius:8px;flex-shrink:0;overflow:hidden;display:flex;align-items:center;justify-content:center;font-size:18px}
.continue-info{flex:1;min-width:0}
.continue-title{font-size:12px;font-weight:600;line-height:1.4;margin-bottom:3px;color:var(--text-dark)}
.continue-pct{font-size:11px;color:var(--text-light);margin-bottom:4px}
.mini-progress{height:4px;background:var(--primary-light);border-radius:2px;overflow:hidden}
.mini-fill{height:100%;background:var(--primary);border-radius:2px}
.live-class-card{background:var(--surface);border-radius:12px;padding:14px;border:1px solid var(--border)}
.live-badge{display:inline-flex;align-items:center;gap:5px;background:var(--primary);color:var(--on-primary);padding:3px 8px;border-radius:5px;font-size:10px;font-weight:700;margin-bottom:8px}
.live-dot{width:6px;height:6px;background:#ff4757;border-radius:50%;animation:pulse 1.5s infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.4}}
.live-class-title{font-size:14px;font-weight:700;margin-bottom:10px;line-height:1.4;color:var(--text-dark)}
.live-instructor{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.live-instructor-name{font-size:12px;font-weight:500;color:var(--text-dark)}
.live-meta{font-size:11.5px;color:var(--text-mid);margin-bottom:12px}
.live-meta i{margin-right:5px;color:var(--primary)}
.btn-join{display:block;text-align:center;padding:10px;background:var(--primary);color:var(--on-primary);border-radius:8px;font-weight:600;font-size:13px;transition:background .2s}
.btn-join:hover{background:var(--primary-dark)}
.instructor-item{display:flex;align-items:center;gap:10px;padding:7px 0}
.avatar-placeholder{width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:13px;flex-shrink:0}
.instructor-info .name{font-size:12.5px;font-weight:600;color:var(--text-dark)}
.instructor-info .role{font-size:11px;color:var(--text-light)}
.instructor-rating{display:flex;align-items:center;gap:3px;font-size:12px;font-weight:600;color:var(--text-dark)}
.instructor-rating i{color:var(--accent);font-size:11px}

/* ===== COURSES PAGE ===== */
.page-header{margin-bottom:20px}
.page-header h1{font-family:'Outfit',sans-serif;font-size:26px;font-weight:800;color:var(--text-dark)}
.page-header p{color:var(--text-mid);font-size:14px;margin-top:4px}
.courses-filter{display:flex;gap:7px;margin-bottom:18px;flex-wrap:wrap}
.filter-btn{padding:6px 14px;border-radius:20px;font-size:12.5px;font-weight:500;cursor:pointer;border:1.5px solid var(--border);background:var(--surface);color:var(--text-mid);transition:all .2s}
.filter-btn:hover,.filter-btn.active{border-color:var(--primary);background:var(--primary);color:var(--on-primary)}
.courses-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:18px}

/* ===== RESPONSIVE ===== */
@media(max-width:1200px){.right-panel{width:240px}}
@media(max-width:1100px){.tutorials-grid{grid-template-columns:repeat(4,1fr)}}
@media(max-width:1024px){
    :root{--right-w:0px}
    .right-panel{display:none}
}
@media(max-width:900px){.tutorials-grid{grid-template-columns:repeat(3,1fr)}.paths-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:768px){
    .hamburger{display:flex}
    .categories-btn{display:none}
    .navbar-center{display:none}
    .become-instructor{display:none}
    .mobile-search{display:block}
    .sidebar{position:fixed;top:0;left:0;height:100vh;z-index:200;transform:translateX(-100%);box-shadow:4px 0 20px rgba(0,0,0,.15)}
    .sidebar.open{transform:translateX(0)}
    .sidebar-overlay{display:block;position:fixed;inset:0;background:var(--overlay);z-index:-1;opacity:0;pointer-events:none;transition:opacity .3s}
    .sidebar.open .sidebar-overlay{opacity:1;pointer-events:all}
    .main-content{padding:14px}
    .hero-banner{padding:22px 22px 0;min-height:170px}
    .hero-content h1{font-size:24px}
    .hero-visual{display:none}
    .tutorials-grid{grid-template-columns:repeat(2,1fr);gap:8px}
    .courses-row{grid-template-columns:repeat(2,1fr);gap:10px}
    .learn-why{grid-template-columns:1fr}
    .why-grid{grid-template-columns:1fr 1fr}
    .paths-grid{grid-template-columns:1fr}
    .ai-grid{grid-template-columns:repeat(2,1fr)}
    .mega-menu{display:none!important}
}
@media(max-width:480px){
    .navbar{padding:0 12px;gap:8px}
    .logo-text{font-size:17px}
    .btn-login{display:none}
    .tutorials-grid{grid-template-columns:repeat(2,1fr)}
    .courses-row{grid-template-columns:repeat(2,1fr)}
    .hero-content h1{font-size:20px}
    .design-grid{grid-template-columns:repeat(2,1fr)}
    .ai-grid{grid-template-columns:repeat(2,1fr)}
    .courses-grid{grid-template-columns:repeat(2,1fr)}
}

@media(prefers-reduced-motion:reduce){
    body{transition:none}
    .course-card,.category-chip,.tutorial-card,.path-card,.design-card,.ai-card{transition:none}
}

/* ===== Dark-theme readability fallback ===== */
/* Preset selectors work even if data-theme-mode is not set by the app. */
:is(html, body)[data-theme-preset="midnight"] .main-content,
:is(html, body)[data-theme-preset="ocean_night"] .main-content,
:is(html, body)[data-theme-preset="purple_night"] .main-content,
:is(html, body)[data-theme-preset="forest_night"] .main-content,
:is(html, body)[data-theme-preset="sunset_dark"] .main-content {
    color: var(--text-dark);
}

/* Use theme variables for common headings and body copy only.
   Component-specific colors (buttons, badges, links, icons) remain intact. */
:is(html, body)[data-theme-preset="midnight"] .main-content h1,
:is(html, body)[data-theme-preset="midnight"] .main-content h2,
:is(html, body)[data-theme-preset="midnight"] .main-content h3,
:is(html, body)[data-theme-preset="midnight"] .main-content h4,
:is(html, body)[data-theme-preset="ocean_night"] .main-content h1,
:is(html, body)[data-theme-preset="ocean_night"] .main-content h2,
:is(html, body)[data-theme-preset="ocean_night"] .main-content h3,
:is(html, body)[data-theme-preset="ocean_night"] .main-content h4,
:is(html, body)[data-theme-preset="purple_night"] .main-content h1,
:is(html, body)[data-theme-preset="purple_night"] .main-content h2,
:is(html, body)[data-theme-preset="purple_night"] .main-content h3,
:is(html, body)[data-theme-preset="purple_night"] .main-content h4,
:is(html, body)[data-theme-preset="forest_night"] .main-content h1,
:is(html, body)[data-theme-preset="forest_night"] .main-content h2,
:is(html, body)[data-theme-preset="forest_night"] .main-content h3,
:is(html, body)[data-theme-preset="forest_night"] .main-content h4,
:is(html, body)[data-theme-preset="sunset_dark"] .main-content h1,
:is(html, body)[data-theme-preset="sunset_dark"] .main-content h2,
:is(html, body)[data-theme-preset="sunset_dark"] .main-content h3,
:is(html, body)[data-theme-preset="sunset_dark"] .main-content h4 {
    color: var(--text-dark);
}

:is(html, body)[data-theme-preset="midnight"] .main-content p,
:is(html, body)[data-theme-preset="ocean_night"] .main-content p,
:is(html, body)[data-theme-preset="purple_night"] .main-content p,
:is(html, body)[data-theme-preset="forest_night"] .main-content p,
:is(html, body)[data-theme-preset="sunset_dark"] .main-content p {
    color: var(--text-mid);
}


/* =====================================================================
   FINAL GLOBAL THEME READABILITY RULES
   Light theme: dark text.
   Dark theme: light text.
   Preserves button, badge, status, and decorative component colors.
===================================================================== */

/* Light preset text variables */
:is(html, body)[data-theme-preset="ocean"],
:is(html, body)[data-theme-preset="lavender"],
:is(html, body)[data-theme-preset="forest"],
:is(html, body)[data-theme-preset="sunset"],
:is(html, body)[data-theme-preset="classic"] {
    color-scheme: light;
    --text-dark: #111827;
    --text-mid: #475569;
    --text-light: #64748b;
}

/* Ensure the root content uses the active theme */
html,
body {
    color: var(--text-dark);
}

body {
    background: var(--bg);
}

/* General content text */
.main-content,
.page-header,
.section-header,
.panel-section,
.sidebar,
.sidebar-nav ul li a,
.categories-btn,
.mega-menu,
.mega-col a,
.card,
.course-card,
.tutorial-card,
.path-card,
.design-card,
.ai-card,
.why-section,
.live-class-card {
    color: var(--text-dark);
}

/* Secondary text */
.page-header p,
.hero-content p,
.course-subtitle,
.instructor-name,
.path-desc,
.ai-info .ai-desc,
.why-item p,
.trusted-section p,
.continue-pct,
.live-meta,
.instructor-info .role,
.form-text,
.text-muted,
.text-secondary,
small {
    color: var(--text-mid);
}

/* Sidebar links and active state */
.sidebar-nav ul li a {
    color: var(--text-mid);
}

.sidebar-nav ul li a:hover,
.sidebar-nav ul li.active a {
    color: var(--primary);
}

/* Keep white text on filled primary buttons and colored labels */
.btn-signup,
.btn-premium,
.btn-explore,
.btn-join,
.filter-btn.active,
.tag-guided,
.badge-bestseller,
.badge-new,
.badge-hot,
.live-badge {
    color: #ffffff;
}

/* Keep badges readable when their primary background is light */
.badge {
    color: var(--on-primary);
}

/* Fields follow active theme variables */
input,
textarea,
select {
    color: var(--text-dark);
    background-color: var(--surface);
    border-color: var(--border);
}

input::placeholder,
textarea::placeholder,
.search-bar input::placeholder {
    color: var(--text-light);
    opacity: 1;
}

/* Icons inside navigation controls follow text */
.categories-btn i,
.categories-btn svg,
.sidebar-nav ul li a i {
    color: inherit;
}

/* Dark preset support even when data-theme-mode is absent */
:is(html, body)[data-theme-preset="midnight"],
:is(html, body)[data-theme-preset="ocean_night"],
:is(html, body)[data-theme-preset="purple_night"],
:is(html, body)[data-theme-preset="forest_night"],
:is(html, body)[data-theme-preset="sunset_dark"] {
    --text-dark: #f8fafc;
    --text-mid: #cbd5e1;
    --text-light: #94a3b8;
    --border: rgba(255, 255, 255, 0.14);
    color-scheme: dark;
}

/* Theme mode takes precedence for the generic dark mode */
:is(html, body)[data-theme-mode="dark"] {
    --text-dark: #f8fafc;
    --text-mid: #cbd5e1;
    --text-light: #94a3b8;
}

/* Autofill text remains legible in dark themes */
:is(html, body)[data-theme-mode="dark"] input:-webkit-autofill,
:is(html, body)[data-theme-preset="midnight"] input:-webkit-autofill,
:is(html, body)[data-theme-preset="ocean_night"] input:-webkit-autofill,
:is(html, body)[data-theme-preset="purple_night"] input:-webkit-autofill,
:is(html, body)[data-theme-preset="forest_night"] input:-webkit-autofill,
:is(html, body)[data-theme-preset="sunset_dark"] input:-webkit-autofill {
    -webkit-text-fill-color: var(--text-dark);
}



/* =========================================
   FIX DARK THEME BLACK TEXT
   Add at the VERY END of the loaded CSS
   ========================================= */

html[data-theme-mode="dark"] body,
body[data-theme-mode="dark"] {
    color: #f8fafc !important;
}

/* Dark sidebar */
html[data-theme-mode="dark"] .sidebar,
html[data-theme-mode="dark"] #sidebar,
html[data-theme-mode="dark"] .admin-sidebar,
body[data-theme-mode="dark"] .sidebar,
body[data-theme-mode="dark"] #sidebar,
body[data-theme-mode="dark"] .admin-sidebar {
    color: #f8fafc !important;
}

/* Sidebar links and labels */
html[data-theme-mode="dark"] .sidebar a,
html[data-theme-mode="dark"] #sidebar a,
html[data-theme-mode="dark"] .admin-sidebar a,
body[data-theme-mode="dark"] .sidebar a,
body[data-theme-mode="dark"] #sidebar a,
body[data-theme-mode="dark"] .admin-sidebar a {
    color: #f8fafc !important;
}

/* Sidebar icons */
html[data-theme-mode="dark"] .sidebar i,
html[data-theme-mode="dark"] #sidebar i,
html[data-theme-mode="dark"] .admin-sidebar i,
body[data-theme-mode="dark"] .sidebar i,
body[data-theme-mode="dark"] #sidebar i,
body[data-theme-mode="dark"] .admin-sidebar i {
    color: #f8fafc !important;
}

/* Dark page headings and descriptions */
html[data-theme-mode="dark"] main h1,
html[data-theme-mode="dark"] main h2,
html[data-theme-mode="dark"] main h3,
html[data-theme-mode="dark"] main p,
html[data-theme-mode="dark"] .main-content h1,
html[data-theme-mode="dark"] .main-content h2,
html[data-theme-mode="dark"] .main-content h3,
html[data-theme-mode="dark"] .main-content p {
    color: #f8fafc !important;
}

/* Keep text dark inside light cards */
html[data-theme-mode="dark"] .card,
html[data-theme-mode="dark"] .card h1,
html[data-theme-mode="dark"] .card h2,
html[data-theme-mode="dark"] .card h3,
html[data-theme-mode="dark"] .card p,
html[data-theme-mode="dark"] .card label,
html[data-theme-mode="dark"] .profile-card,
html[data-theme-mode="dark"] .profile-card h1,
html[data-theme-mode="dark"] .profile-card h2,
html[data-theme-mode="dark"] .profile-card h3,
html[data-theme-mode="dark"] .profile-card p,
html[data-theme-mode="dark"] .profile-card label {
    color: #111827;
}

/* Inputs */
html[data-theme-mode="dark"] input,
html[data-theme-mode="dark"] textarea,
html[data-theme-mode="dark"] select {
    color: #f8fafc;
    background-color: #1e293b;
}

