/*
Theme Name:   OokaSpeak
Theme URI:    https://ookaspeak.com
Author:       Noudizay Agency
Author URI:   https://noudizay.com
Description:  A premium English learning platform theme inspired by Engoo. Features a clean card-grid layout, blue-accented UI, and is Phase-2 ready for a tutor-booking homepage transition.
Version:      2.0.0
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  ookaspeak
Tags:         e-learning, custom-colors, custom-menu, responsive
*/

/* ============================================================
   TABLE OF CONTENTS
   1.  CSS Variables & Design Tokens
   2.  CSS Reset & Base Styles
   3.  Typography
   4.  Utilities
   5.  Navigation
   6.  Language Switcher
   7.  Hero Strip
   8.  Category Tabs Bar
   9.  Page Layout (Sidebar + Main)
   10. Sidebar Filters
   11. Lesson Cards Grid
   12. Active Filter Chips
   13. Empty State
   14. Lesson Single Page
   15. Sidebar – Lesson Info
   16. Footer
   17. Responsive Breakpoints
   ============================================================ */


/* ============================================================
   1. CSS VARIABLES & DESIGN TOKENS
   ============================================================ */
:root {
  /* Brand Colors — Engoo-inspired blue palette */
  --brand:          #1565C0;
  --brand-dark:     #0D47A1;
  --brand-light:    #E3F2FD;
  --brand-glow:     rgba(21, 101, 192, 0.18);

  /* Accent — warm CTA orange */
  --accent:         #E65100;
  --accent-light:   #FFF3E0;

  /* Text */
  --text:           #1A1A2E;
  --text-muted:     #6B7280;
  --text-light:     #9CA3AF;

  /* Surfaces */
  --bg:             #F5F7FC;
  --white:          #FFFFFF;
  --border:         #E5E7EB;
  --border-strong:  #D1D5DB;

  /* Shadows */
  --shadow-xs:      0 1px 3px rgba(0,0,0,0.07);
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:      0 8px 24px rgba(0,0,0,0.11);
  --shadow-lg:      0 16px 48px rgba(0,0,0,0.14);
  --shadow-blue:    0 4px 14px rgba(21,101,192,0.22);

  /* Border Radius */
  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      14px;
  --radius-xl:      20px;
  --radius-full:    9999px;

  /* Level Colors */
  --lvl-1-bg:   #E8F5E9; --lvl-1-text: #2E7D32;
  --lvl-2-bg:   #E3F2FD; --lvl-2-text: #1565C0;
  --lvl-3-bg:   #FFF8E1; --lvl-3-text: #F57F17;
  --lvl-4-bg:   #FCE4EC; --lvl-4-text: #C62828;
  --lvl-5-bg:   #F3E5F5; --lvl-5-text: #6A1B9A;
  --lvl-6-bg:   #E8EAF6; --lvl-6-text: #283593;
  --lvl-7-bg:   #FBE9E7; --lvl-7-text: #BF360C;
  --lvl-8-bg:   #F1F8E9; --lvl-8-text: #33691E;
  --lvl-9-bg:   #E0F2F1; --lvl-9-text: #00695C;
  --lvl-10-bg:  #212121; --lvl-10-text: #FFD54F;

  /* Spacing */
  --nav-height: 60px;
}


/* ============================================================
   0. PAGE LOADER
   ============================================================ */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  transition: opacity 0.3s ease, visibility 0.3s ease;
  /* Hidden by default — JS shows it on navigation; safe if JS is delayed by cache plugins */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#page-loader.loader-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modern-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(21, 101, 192, 0.12);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spinner-spin 0.75s linear infinite;
}

@keyframes spinner-spin {
  to { transform: rotate(360deg); }
}


/* ============================================================
   2. CSS RESET & BASE STYLES
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', 'Nunito', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

ul, ol {
  list-style: none;
}


/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  font-weight: 700;
}

.article-body {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
}

.article-body p {
  margin-bottom: 1.25em;
}

.article-body p:last-child {
  margin-bottom: 0;
}


/* ============================================================
   4. UTILITIES
   ============================================================ */
.container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s, transform 0.12s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-outline {
  border: 1.5px solid var(--border-strong);
  color: var(--text);
  background: var(--white);
}

.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-light);
}

.btn-solid {
  background: var(--brand);
  color: var(--white);
}

.btn-solid:hover {
  background: var(--brand-dark);
  box-shadow: var(--shadow-blue);
}

.btn-accent {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 3px 10px rgba(230,81,0,0.28);
}

.btn-accent:hover {
  background: #BF360C;
  box-shadow: 0 5px 16px rgba(230,81,0,0.38);
}


/* ============================================================
   5. NAVIGATION
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--nav-height);
}

/* Logo */
.site-logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.site-logo:hover { opacity: 0.85; }

.site-logo svg {
  width: 26px;
  height: 26px;
}

.custom-logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.custom-logo-link:hover { opacity: 0.85; }

.custom-logo-link .custom-logo {
  height: 36px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
}

/* Nav Links */
.nav-links {
  display: flex;
  gap: 2px;
  flex: 1;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}

.nav-links a:hover {
  background: var(--brand-light);
  color: var(--brand);
}

.nav-links a.current-menu-item {
  background: var(--brand-light);
  color: var(--brand);
  font-weight: 600;
}

/* Nav Right */
.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Mobile Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.22s;
}


/* ============================================================
   6. LANGUAGE SWITCHER
   ============================================================ */
.lang-switcher { position: relative; }

.lang-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--white);
  font-size: 12px; font-weight: 700; color: var(--text);
  cursor: pointer; font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.lang-btn:hover { border-color: var(--brand); }
.lang-btn.is-open {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.lang-flag { font-size: 1.15em; line-height: 1; }
.lang-chevron { transition: transform 0.2s; opacity: 0.45; }
.lang-btn.is-open .lang-chevron { transform: rotate(180deg); }

.lang-dropdown {
  display: none; flex-direction: column;
  position: absolute; top: calc(100% + 7px); right: 0;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  min-width: 155px; z-index: 500; overflow: hidden;
}
.lang-switcher.is-open .lang-dropdown { display: flex; }

.lang-option {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; font-size: 13px; color: var(--text);
  text-decoration: none; transition: background 0.1s;
  border-bottom: 1px solid var(--border);
}
.lang-option:last-child { border-bottom: none; }
.lang-option:hover { background: var(--bg); }
.lang-option.is-active { background: var(--brand-light); color: var(--brand); }
.lang-option.is-active svg { color: var(--brand); }
.lang-option-code {
  font-weight: 800; font-size: 11px; letter-spacing: .03em;
  color: var(--text-light); min-width: 22px;
}
.lang-option.is-active .lang-option-code { color: var(--brand); }


/* ============================================================
   7. HERO STRIP
   ============================================================ */
.hero {
  background: linear-gradient(135deg, #1565C0 0%, #0277BD 60%, #01579B 100%);
  padding: 44px 24px 48px;
  text-align: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 50%, rgba(255,255,255,0.07) 0%, transparent 55%),
    radial-gradient(circle at 85% 15%, rgba(255,255,255,0.05) 0%, transparent 50%);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 800;
  margin-bottom: 10px;
  position: relative;
}

.hero p {
  font-size: 15px;
  opacity: 0.85;
  margin-bottom: 24px;
  position: relative;
}

/* Search Bar */
.search-bar {
  display: flex;
  max-width: 540px;
  margin-inline: auto;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
  position: relative;
}

.search-bar input[type="text"] {
  flex: 1;
  border: none;
  outline: none;
  padding: 13px 18px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: transparent;
}

.search-bar input[type="text"]::placeholder {
  color: var(--text-light);
}

.search-bar button[type="submit"] {
  background: var(--brand);
  border: none;
  padding: 0 22px;
  cursor: pointer;
  color: var(--white);
  font-size: 15px;
  transition: background 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.search-bar button[type="submit"]:hover {
  background: var(--brand-dark);
}


/* ============================================================
   8. CATEGORY TABS BAR
   ============================================================ */
.tabs-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  position: sticky;
  top: var(--nav-height);
  z-index: 50;
}

.tabs-bar::-webkit-scrollbar { display: none; }

.tabs-inner {
  display: flex;
  gap: 0;
}

.tab {
  padding: 13px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.12s, border-color 0.12s;
  display: block;
}

.tab:hover { color: var(--brand); }

.tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}


/* ============================================================
   9. PAGE LAYOUT
   ============================================================ */
.page-body {
  max-width: 1200px;
  margin-inline: auto;
  padding: 28px 24px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}

.main-area { min-width: 0; }


/* ============================================================
   10. SIDEBAR FILTERS
   ============================================================ */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: calc(var(--nav-height) + 50px);
}

.filter-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px;
  box-shadow: var(--shadow-xs);
}

.filter-card h3 {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-light);
  margin-bottom: 12px;
}

.filter-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filter-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: background 0.1s;
}

.filter-list a:hover { background: var(--bg); }

.filter-list a.active {
  background: var(--brand-light);
  color: var(--brand);
  font-weight: 600;
}

.filter-count {
  font-size: 11px;
  font-weight: 600;
  background: var(--bg);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.filter-list a.active .filter-count {
  background: var(--brand);
  color: var(--white);
}

.level-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 7px;
  flex-shrink: 0;
}


/* ============================================================
   11. LESSON CARDS GRID
   ============================================================ */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 10px;
}

.results-count {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.sort-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  cursor: pointer;
  outline: none;
  transition: border-color 0.12s;
}

.sort-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

/* Individual Lesson Card */
.lesson-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.22s, transform 0.22s, border-color 0.22s;
  position: relative;
}

.lesson-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

/* Card Image */
.card-image {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: var(--bg);
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.lesson-card:hover .card-image img {
  transform: scale(1.04);
}

/* Category tag overlay */
.card-category-tag {
  position: absolute;
  top: 9px;
  left: 9px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Bookmark button */
.card-bookmark {
  position: absolute;
  top: 9px;
  right: 9px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.12s, transform 0.18s;
  box-shadow: var(--shadow-xs);
}

.card-bookmark:hover {
  background: var(--white);
  transform: scale(1.1);
}

.card-bookmark.is-saved {
  background: #FFF0F3;
}
.card-bookmark.is-saved svg {
  fill: #E91E63;
  stroke: #E91E63;
}

/* Lock badge — shown on cards when user is not logged in */
.card-lock-badge {
  position: absolute;
  bottom: 9px;
  right: 9px;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  pointer-events: none;
}

/* Locked card: dim image slightly */
.lesson-card.is-locked .card-image img,
.lesson-card.is-locked .card-image-placeholder {
  filter: brightness(0.88);
}

/* Card Body */
.card-body {
  padding: 25px 25px 25px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

/* Level badge */
.card-level {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  width: fit-content;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Card Title */
.card-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

/* Card Description */
.card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Footer */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 9px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.card-topic {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Level breakdown on category cards */
.card-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 6px 12px 9px;
  border-top: 1px solid var(--border);
}
.clr-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  white-space: nowrap;
}
.clr-count {
  background: rgba(0,0,0,.12);
  border-radius: 99px;
  padding: 0 4px;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.5;
}

.topic-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}


/* ============================================================
   12. ACTIVE FILTER CHIPS
   ============================================================ */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--brand-light);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(21,101,192,0.18);
}

.filter-chip-remove {
  color: var(--brand);
  font-size: 15px;
  line-height: 1;
  opacity: 0.55;
  transition: opacity 0.12s, color 0.12s;
  display: flex;
  align-items: center;
}

.filter-chip-remove:hover {
  opacity: 1;
  color: #C62828;
}


/* ============================================================
   13. EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  margin-bottom: 14px;
  opacity: 0.22;
}

.empty-state h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.empty-state p { font-size: 14px; }

.empty-state a {
  display: inline-block;
  margin-top: 14px;
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
}


/* ============================================================
   14. LESSON SINGLE PAGE
   ============================================================ */
.lesson-page {
  max-width: 1100px;
  margin-inline: auto;
  padding: 28px 24px;
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 28px;
  align-items: start;
}

.lesson-main { min-width: 0; }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.breadcrumb a {
  color: var(--brand);
  font-weight: 500;
}

.breadcrumb a:hover { text-decoration: underline; }

.breadcrumb-sep { opacity: 0.35; }

/* Lesson Hero Image */
.lesson-hero {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 22px;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.lesson-hero img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
}

.lesson-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 55%);
}

.lesson-hero-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 18px 22px;
  color: var(--white);
}

.lesson-hero-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  opacity: 0.88;
  flex-wrap: wrap;
}

.lesson-hero-meta .level-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
}

.lesson-hero h1 {
  font-size: clamp(17px, 2.8vw, 24px);
  font-weight: 800;
  line-height: 1.25;
}

/* Content Sections */
.lesson-section {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}

.lesson-section h2 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.section-icon {
  font-size: 18px;
  line-height: 1;
}

/* Vocabulary List */
.vocab-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vocab-item {
  padding: 11px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--brand);
  transition: background 0.12s;
}

.vocab-item:hover { background: var(--brand-light); }

.vocab-word {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 3px;
}

.vocab-def {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Discussion Questions */
.discussion-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-reset: discussion-q;
}

.discussion-item {
  counter-increment: discussion-q;
  padding: 12px 14px;
  background: var(--brand-light);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  gap: 11px;
  align-items: flex-start;
  line-height: 1.5;
  border: 1px solid rgba(21,101,192,0.12);
}

.discussion-item::before {
  content: counter(discussion-q);
  background: var(--brand);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}


/* ============================================================
   15. LESSON SIDEBAR — INFO
   ============================================================ */
.lesson-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: calc(var(--nav-height) + 16px);
}

.sidebar-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px;
  box-shadow: var(--shadow-xs);
}

.sidebar-card h3 {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-light);
  margin-bottom: 12px;
}

/* Start Lesson Button */
.start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  background: var(--brand);
  color: var(--white);
  padding: 13px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  transition: background 0.15s, box-shadow 0.15s, transform 0.12s;
  margin-bottom: 10px;
  box-shadow: var(--shadow-blue);
}

.start-btn:hover {
  background: var(--brand-dark);
  box-shadow: 0 6px 20px rgba(21,101,192,0.38);
  transform: translateY(-1px);
}

/* Bookmark Button */
.bookmark-btn {
  display: block;
  width: 100%;
  text-align: center;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  padding: 10px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  font-family: inherit;
}

.bookmark-btn:hover {
  background: var(--brand-light);
  border-color: var(--brand);
  color: var(--brand);
}

/* Info Rows */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.info-row:last-child { border-bottom: none; }

.info-label {
  color: var(--text-muted);
  font-weight: 500;
}

.info-value {
  font-weight: 600;
  color: var(--text);
}

/* Progress Bar */
.progress-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.progress-bar-bg {
  background: var(--bg);
  border-radius: var(--radius-full);
  height: 7px;
  overflow: hidden;
  margin: 7px 0;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--brand);
  transition: width 0.6s ease;
}


/* ============================================================
   16. FOOTER
   ============================================================ */
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  margin-top: 56px;
}

.footer-inner {
  max-width: 1200px;
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
}

.footer-logo {
  font-size: 16px;
  font-weight: 800;
  color: var(--brand);
}

.footer-copy {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links { display: flex; gap: 16px; }

.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.12s;
}

.footer-links a:hover { color: var(--brand); }


/* ============================================================
   17. RESPONSIVE BREAKPOINTS
   ============================================================ */

/* ── Mobile level bar (hidden on desktop) ─────────────────── */
.mobile-level-bar {
  display: none;
}

/* ── Mobile filter toggle wrapper + button (hidden on desktop) ── */
.mobile-filter-wrap,
.mobile-filter-toggle {
  display: none;
}

/* ── Tablet: 900px ─────────────────────────────────────── */
@media (max-width: 900px) {
  .page-body {
    grid-template-columns: 190px 1fr;
    gap: 16px;
    padding: 20px 16px;
  }
  .lesson-page {
    grid-template-columns: 1fr 240px;
    padding: 20px 16px;
  }
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
  }
}

/* ── Mobile: 768px ─────────────────────────────────────── */
@media (max-width: 768px) {

  /* ── Nav ── */
  .nav-inner { gap: 10px; }
  .nav-links { display: none; }
  .nav-right { margin-left: auto; }
  .nav-toggle { display: flex; }

  /* Prevent logo text from wrapping */
  .site-logo { font-size: 17px; }
  .custom-logo-link .custom-logo { max-width: 120px; }

  /* Slide-down mobile menu */
  .nav-links.is-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px 18px;
    gap: 2px;
    z-index: 999;
    box-shadow: var(--shadow-md);
    animation: mobileMenuSlide 0.18s ease;
  }

  @keyframes mobileMenuSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .nav-links.is-open a {
    padding: 10px 12px;
    font-size: 15px;
    border-radius: var(--radius-sm);
  }

  /* Hamburger → X animation */
  .nav-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle.is-open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }
  .nav-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Keep language switcher visible on mobile */
  .nav-right { gap: 6px; }
  .lang-btn { padding: 5px 8px; font-size: 11px; }
  .lang-dropdown { right: 0; min-width: 140px; }

  /* Auth buttons: keep Sign up and Dashboard visible */
  #nav-login { display: none; }
  #nav-logout { display: none; }

  /* ── Layout ── */
  .page-body {
    grid-template-columns: 1fr;
    padding: 16px 14px;
    gap: 12px;
  }

  /* Sidebar hidden by default — toggled by .is-mobile-open */
  .sidebar,
  .materials-sidebar {
    display: none;
    position: static;
    top: auto;
  }

  .sidebar.is-mobile-open,
  .materials-sidebar.is-mobile-open {
    display: flex !important;
    animation: slideDown 0.2s ease;
  }

  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* ── Mobile level bar (range slider) ── */
  .mobile-level-bar {
    display: block;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 36px 24px 14px;
    user-select: none;
    -webkit-user-select: none;
  }

  /* Track: the container for rail + pips + handles */
  .mlb-track-wrap {
    position: relative;
    height: 24px;
    margin: 0 11px; /* half handle width so handles don't bleed */
  }

  /* Colored gradient rail */
  .mlb-rail {
    position: absolute;
    left: 0; right: 0; top: 50%;
    transform: translateY(-50%);
    height: 5px;
    border-radius: 99px;
    /* background gradient set inline via PHP */
    pointer-events: none;
  }

  /* Pulse animation — stops once user has dragged */
  @keyframes mlb-pip-pulse {
    0%, 100% { box-shadow: 0 0 0 1.5px var(--nd-color); }
    50%       { box-shadow: 0 0 0 4px var(--nd-color), 0 0 10px 3px var(--nd-bg); opacity: .8; }
  }

  /* Small colored dots at each level position */
  .mlb-pip {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--nd-bg);
    border: 2px solid #fff;
    box-shadow: 0 0 0 1.5px var(--nd-color);
    z-index: 3;
    pointer-events: none;
    transition: transform 0.15s;
    animation: mlb-pip-pulse 1.6s ease-in-out infinite;
  }
  .mlb-pip:nth-child(odd)  { animation-delay: 0s; }
  .mlb-pip:nth-child(even) { animation-delay: 0.3s; }

  /* Stop animation once user has interacted */
  #mlb-container.ooks-dragged .mlb-pip {
    animation: none;
  }

  .mlb-pip.in-range {
    transform: translate(-50%, -50%) scale(1.25);
    box-shadow: 0 0 0 2px var(--nd-color), 0 2px 6px rgba(0,0,0,0.18);
  }

  /* Draggable handle circles */
  .mlb-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid #1A1A2E;
    z-index: 10;
    cursor: grab;
    touch-action: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.22);
    transition: box-shadow 0.15s, transform 0.1s;
  }
  .mlb-handle.is-dragging,
  .mlb-handle:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 4px 16px rgba(0,0,0,0.28);
  }

  /* Tooltip labels above each handle */
  .mlb-lbl {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #1A1A2E;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 5px;
    white-space: nowrap;
    pointer-events: none;
  }
  .mlb-lbl::after {
    content: '';
    position: absolute;
    top: 100%; left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1A1A2E;
  }

  /* Group labels row */
  .mlb-group-labels {
    display: flex;
    justify-content: space-between;
    padding: 10px 0 2px;
    font-size: 9px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  /* Mobile filter wrapper + toggle button */
  .mobile-filter-wrap { display: block; }
  .mobile-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    margin-bottom: 14px;
  }

  .mobile-filter-toggle:hover,
  .mobile-filter-toggle.is-active {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-light);
  }

  .mobile-filter-toggle .mft-badge {
    background: var(--brand);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-full);
    padding: 1px 6px;
    display: none;
  }

  .mobile-filter-toggle.has-filters .mft-badge { display: inline; }

  /* ── Lesson page ── */
  .lesson-page {
    grid-template-columns: 1fr;
    padding: 16px 14px;
  }

  .lesson-sidebar {
    position: relative;
    top: auto;
    order: -1;
  }

  /* ── Hero ── */
  .hero { padding: 26px 16px 30px; }
  .hero h1 { font-size: 23px; }
  .hero p  { font-size: 15px; margin-bottom: 18px; }

  .search-bar input[type="text"] { padding: 11px 14px; font-size: 15px; }
  .search-bar button[type="submit"] { padding: 0 16px; }

  /* ── Cards — larger text on mobile ── */
  .cards-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .card-title   { font-size: 15px; }
  .card-desc    { font-size: 13px; }
  .card-footer  { font-size: 12px; }
  .card-level   { font-size: 11px; }
  .card-body    { padding: 16px; }

  /* ── Category tabs bar ── */
  .tab { padding: 11px 14px; font-size: 14px; }

  /* ── Results header ── */
  .results-count { font-size: 13px; }
  .sort-select   { font-size: 13px; }

  /* ── Dashboard ── */
  .dash-stat-n          { font-size: 1.5rem; }
  .dash-stat-lbl        { font-size: .8rem; }
  .dash-section-title   { font-size: 1rem; }
  .dash-lesson-title    { font-size: .95rem; }
  .dash-mini-title      { font-size: .85rem; }
  .dash-prog-stat-n     { font-size: 1.4rem; }
  .dash-prog-stat-l     { font-size: .78rem; }

  /* ── Category archive ── */
  .tc-series-name  { font-size: .95rem; }
  .tc-row-title    { font-size: .88rem; }
  .tc-series-desc  { font-size: .82rem; }
  .tc-row-num      { font-size: .75rem; }

  /* ── Footer ── */
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .footer-links { justify-content: center; }
}

/* ── Small Mobile: 560px ───────────────────────────────── */
@media (max-width: 560px) {
  /* At this width 2-col cards are too narrow — go 1 col */
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Tabs bar */
  .tab { padding: 11px 12px; font-size: 13px; }
}

/* ── Extra Small: 480px ────────────────────────────────── */
@media (max-width: 480px) {
  /* Keep sign-up and dashboard buttons visible on extra small screens */
  #nav-signup,
  #nav-dashboard { 
    padding: 6px 10px;
    font-size: 12px;
  }

  .lesson-hero img { height: 200px; }

  .container { padding-inline: 14px; }

  .hero { padding: 22px 14px 26px; }

  /* Results header: stack sort below count */
  .results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .sort-select { width: 100%; }
}


/* ============================================================
   18. AUTH PAGES — Login & Sign-up
   ============================================================ */

.auth-page {
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 40px 16px;
}
.auth-page--wide { align-items: flex-start; padding-top: 32px; }

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px 36px;
  width: 100%;
  max-width: 440px;
}
.auth-card--wide { max-width: 560px; }

/* Logo */
.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 24px;
}
.auth-logo:hover { color: var(--brand); }

/* Heading */
.auth-title { font-size: 22px; font-weight: 800; color: var(--text); margin: 0 0 6px; }
.auth-sub   { font-size: 14px; color: var(--text-muted); margin: 0 0 24px; }

/* Alert */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  line-height: 1.5;
}
.auth-alert--error {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}
.auth-alert--error svg { color: #EF4444; flex-shrink: 0; margin-top: 1px; }

/* Form layout */
.auth-form  { display: flex; flex-direction: column; gap: 16px; }
.auth-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-field { display: flex; flex-direction: column; gap: 5px; }
.auth-field-head { display: flex; align-items: center; justify-content: space-between; }

.auth-label { font-size: 13px; font-weight: 600; color: var(--text); }

/* Input */
.auth-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.auth-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.auth-input.is-error { border-color: #EF4444; }
.auth-input::placeholder { color: var(--text-light); }

/* Password toggle */
.auth-pw-wrap { position: relative; }
.auth-pw-wrap .auth-input { padding-right: 44px; }
.auth-pw-toggle {
  position: absolute;
  top: 50%; right: 12px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}
.auth-pw-toggle:hover { color: var(--text); }

.auth-forgot { font-size: 12px; font-weight: 600; color: var(--brand); text-decoration: none; }
.auth-forgot:hover { text-decoration: underline; }

/* Custom checkbox */
.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  user-select: none;
  -webkit-user-select: none;
}
.auth-remember input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.auth-check-box {
  width: 18px; height: 18px;
  border-radius: 4px;
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, border-color 0.12s;
}
.auth-remember input:checked ~ .auth-check-box {
  background: var(--brand);
  border-color: var(--brand);
}
.auth-remember input:checked ~ .auth-check-box::after {
  content: '';
  width: 9px; height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  display: block;
}

/* Submit button */
.auth-submit {
  padding: 12px 20px;
  background: var(--brand);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  box-shadow: var(--shadow-blue);
  margin-top: 4px;
}
.auth-submit:hover  { background: var(--brand-dark); box-shadow: 0 6px 20px rgba(21,101,192,0.3); }
.auth-submit:active { transform: scale(0.98); }

/* Or-divider */
.auth-divider { position: relative; text-align: center; margin: 20px 0 12px; }
.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
.auth-divider span {
  position: relative;
  background: var(--white);
  padding: 0 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Social buttons placeholder */
.auth-social-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: not-allowed;
  color: var(--text-muted);
  opacity: 0.7;
}
.auth-soon-badge {
  background: var(--brand-light);
  color: var(--brand);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Bottom switch line */
.auth-switch { text-align: center; font-size: 13px; color: var(--text-muted); margin: 20px 0 0; }
.auth-link { color: var(--brand); font-weight: 700; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

/* Learning goal grid */
.auth-goals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 6px;
}
.auth-goal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  transition: border-color 0.12s, background 0.12s, color 0.12s;
  user-select: none;
  -webkit-user-select: none;
}
.auth-goal input[type="radio"] { display: none; }
.auth-goal-ico  { display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.auth-goal:hover { border-color: var(--brand); color: var(--brand); }
.auth-goal:hover .auth-goal-ico { color: var(--brand); }
.auth-goal.is-selected {
  border-color: var(--brand);
  background: var(--brand-light);
  color: var(--brand);
}
.auth-goal.is-selected .auth-goal-ico { color: var(--brand); }

/* ── Auth responsive ── */
@media (max-width: 560px) {
  .auth-card { padding: 28px 20px; }
  .auth-row-2 { grid-template-columns: 1fr; }
  .auth-goals { grid-template-columns: repeat(2, 1fr); }
}


/* ============================================================
   19. STUDENT DASHBOARD
   ============================================================ */

.dash-wrap {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 72px);
  background: var(--bg);
}

/* ── Sidebar ── */
.dash-sidebar {
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
}

.dash-profile-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.dash-avatar-ring { position: relative; flex-shrink: 0; }
.dash-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 3px solid var(--ring-color, var(--brand));
  object-fit: cover;
  display: block;
}

.dash-profile-name  { font-size: 14px; font-weight: 700; color: var(--text); margin: 0 0 4px; }
.dash-level-badge   { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; }

.dash-goal-line {
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 4px 12px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

/* Nav */
.dash-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.dash-nav-item:hover           { background: var(--bg); color: var(--text); }
.dash-nav-item.is-active       { background: var(--brand-light); color: var(--brand); }
.dash-nav-item--soon           { opacity: 0.6; pointer-events: none; }

.dash-soon-pill {
  margin-left: auto;
  background: var(--bg);
  color: var(--text-light);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.dash-sidebar-footer { padding-top: 14px; border-top: 1px solid var(--border); margin-top: 8px; }
.dash-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: var(--radius);
  transition: background 0.12s, color 0.12s;
}
.dash-logout:hover { background: #FEF2F2; color: #B91C1C; }

/* ── Main content ── */
.dash-main { padding: 28px 32px; min-width: 0; overflow-x: hidden; }

.dash-welcome-flash {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--brand-light);
  color: var(--brand-dark);
  border: 1px solid #BBDEFB;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
  line-height: 1.4;
}
.dash-welcome-flash strong { font-weight: 800; }
.dash-flash-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--brand-dark);
  padding: 0 4px;
  line-height: 1;
}

.dash-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 12px;
}
.dash-page-title { font-size: 22px; font-weight: 800; color: var(--text); margin: 0 0 3px; }
.dash-page-sub   { font-size: 13px; color: var(--text-muted); margin: 0; }
.dash-sidebar-toggle { display: none; }

/* Stats row */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.dash-stat-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.dash-stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-stat-icon--blue   { background: var(--brand-light); }
.dash-stat-icon--blue   svg { stroke: var(--brand); }
.dash-stat-icon--orange { background: #FFF3E0; }
.dash-stat-icon--orange svg { stroke: var(--accent); }
.dash-stat-icon--green  { background: #F0FDF4; }
.dash-stat-icon--green  svg { stroke: #16A34A; }

.dash-stat-n    { display: block; font-size: 18px; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 3px; }
.dash-stat-lbl  { font-size: 11px; color: var(--text-muted); font-weight: 600; display: block; }
.dash-stat-soon { font-size: 9px; font-weight: 400; color: var(--text-light); }

/* Sections */
.dash-section { margin-bottom: 32px; }
.dash-section-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.dash-section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}
.dash-section-title svg { color: var(--text-muted); flex-shrink: 0; }

.dash-badge-soon {
  background: var(--bg);
  color: var(--text-light);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .04em;
  border: 1px solid var(--border);
}

.dash-see-all { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--brand); text-decoration: none; }
.dash-see-all:hover { text-decoration: underline; }

/* Empty state */
.dash-empty {
  background: var(--white);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}
.dash-empty svg { color: var(--text-light); margin-bottom: 12px; }
.dash-empty p   { margin: 0 0 16px; }
.dash-empty small { font-size: 12px; color: var(--text-light); }
.dash-link-btn {
  display: inline-block;
  padding: 9px 20px;
  background: var(--brand);
  color: var(--white);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.dash-link-btn:hover { background: var(--brand-dark); }

/* Coming-soon promo cards */
.dash-promo-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.dash-promo-card--accent { border-left: 4px solid var(--brand); }
.dash-promo-icon { display:flex; align-items:center; justify-content:center; width:48px; height:48px; border-radius:12px; background:var(--bg); margin-bottom:12px; }
.dash-promo-icon svg { width:26px; height:26px; stroke:var(--brand); }
.dash-promo-card h3 { font-size: 15px; font-weight: 800; color: var(--text); margin: 0 0 6px; }
.dash-promo-card p  { font-size: 13px; color: var(--text-muted); margin: 0 0 14px; line-height: 1.6; }
.dash-promo-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.dash-promo-tags span {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Mini bookmarks grid */
.dash-mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.dash-mini-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.dash-mini-card:hover { box-shadow: var(--shadow-sm); border-color: var(--brand); }
.dash-mini-lvl    { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 99px; align-self: flex-start; }
.dash-mini-title  { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; }

/* Progress section */
.dash-progress-wrap {
  margin-bottom: 1.25rem;
}
.dash-progress-bar-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: .82rem; margin-bottom: .45rem;
}
.dash-progress-label { color: var(--text-muted); }
.dash-progress-pct   { font-weight: 700; color: var(--brand); }
.dash-progress-track {
  height: 8px; background: var(--border); border-radius: 99px; overflow: hidden;
}
.dash-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--brand) 0%, #42A5F5 100%);
  border-radius: 99px; transition: width 0.6s ease;
}
.dash-prog-stats {
  display: flex; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.dash-prog-stat {
  flex: 1; min-width: 80px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .75rem 1rem; text-align: center;
}
.dash-prog-stat-n {
  display: block; font-size: 1.35rem; font-weight: 800; color: var(--brand); line-height: 1.2;
}
.dash-prog-stat-l {
  display: block; font-size: .72rem; color: var(--text-muted); margin-top: .2rem;
}
.dash-prog-subtitle {
  font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); margin: 0 0 .65rem;
}
.dash-mini-card--done {
  border-color: #C8E6C9;
}
.dash-mini-check {
  margin-left: auto; flex-shrink: 0;
}

/* Lesson card grid */
.dash-lesson-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.dash-lesson-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s, transform 0.15s;
}
.dash-lesson-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.dash-lesson-thumb img  { width: 100%; height: 140px; object-fit: cover; display: block; }
.dash-lesson-body       { padding: 12px 14px; flex: 1; }
.dash-lesson-meta-row   { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-bottom: 6px; }
.dash-lesson-lvl        { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 99px; }
.dash-lesson-topic,
.dash-lesson-dur        { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.dash-lesson-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Dashboard responsive ── */
@media (max-width: 1100px) {
  .dash-stats       { grid-template-columns: repeat(2, 1fr); }
  .dash-lesson-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .dash-wrap { grid-template-columns: 200px 1fr; }
  .dash-main { padding: 20px; }
}

@media (max-width: 768px) {
  .dash-wrap { grid-template-columns: 1fr; }

  .dash-sidebar {
    position: fixed;
    top: 0; left: -270px;
    width: 260px;
    height: 100vh;
    z-index: 300;
    box-shadow: var(--shadow-lg);
    transition: left 0.25s ease;
    padding-top: 72px;
  }
  .dash-sidebar.is-open { left: 0; }

  .dash-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 299;
  }
  .dash-sidebar.is-open ~ .dash-sidebar-overlay { display: block; }

  .dash-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text);
    flex-shrink: 0;
  }

  .dash-main  { padding: 16px; }
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .dash-lesson-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .dash-stats       { grid-template-columns: 1fr 1fr; gap: 8px; }
  .dash-lesson-grid { grid-template-columns: 1fr; }
  .dash-stat-card   { padding: 12px; }
  .dash-stat-icon   { width: 34px; height: 34px; }
  .dash-stat-n      { font-size: 16px; }
}

/* Hide the standard site footer on auth & dashboard pages */
.page-template-page-login .site-footer,
.page-template-page-signup .site-footer  { display: none; }

/* ── Back-to-top button ─────────────────────────────────── */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 999;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: #2563eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 4px 14px rgba(37,99,235,.40);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity .25s, transform .25s, visibility .25s, background .2s;
}
.back-to-top.btt-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover  { background: #1d4ed8; box-shadow: 0 6px 18px rgba(37,99,235,.55); }
.back-to-top:active { transform: scale(.93); }

/* progress ring — sits slightly outside the button circle */
.btt-ring {
    position: absolute;
    top: -5px; left: -5px;
    width: 56px; height: 56px;
    transform: rotate(-90deg);
    pointer-events: none;
    overflow: visible;
}
.btt-ring-track {
    fill: none;
    stroke: rgba(255,255,255,.25);
    stroke-width: 2.5;
}
.btt-ring-fill {
    fill: none;
    stroke: #fff;
    stroke-width: 2.5;
    stroke-linecap: round;
    transition: stroke-dashoffset .12s linear;
}

/* arrow icon */
.btt-arrow {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

@media (max-width: 600px) {
    .back-to-top { bottom: 20px; right: 18px; width: 42px; height: 42px; }
    .btt-ring     { top: -5px; left: -5px; width: 52px; height: 52px; }
}

