/* ==========================================================================
   CURYAMP DESIGN SYSTEM & STYLESHEET
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS VARIABLES & SYSTEM TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --primary-light: rgba(99, 102, 241, 0.08);
  --primary-glow: rgba(99, 102, 241, 0.25);

  --accent: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);

  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-glass-hover: rgba(255, 255, 255, 0.95);
  --bg-glass-strong: rgba(255, 255, 255, 0.97);
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;

  --text-main: #0f172a;
  --text-heading: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --text-inverse: #ffffff;

  --border-light: #e2e8f0;
  --border-glass: rgba(226, 232, 240, 0.8);
  --border-subtle: rgba(226, 232, 240, 0.6);
  --border-focus: #818cf8;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 40px -15px rgba(99, 102, 241, 0.15);
  --shadow-hover: 0 25px 50px -12px rgba(99, 102, 241, 0.25);

  /* Gradients & Easings */
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Font */
  --font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-page);
  background-image: 
    radial-gradient(at 100% 0%, rgba(99, 102, 241, 0.06) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(6, 182, 212, 0.06) 0px, transparent 50%);
  background-attachment: fixed;
  overflow-x: hidden;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

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

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

p {
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   3. NAVIGATION HEADER
   -------------------------------------------------------------------------- */
header {
  max-width: 1280px;
  width: calc(100% - 2rem);
  margin: 1rem auto;
  position: sticky;
  top: 1rem;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  transition: var(--transition-normal);
}

header:hover {
  box-shadow: var(--shadow-md);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 1.75rem;
}

.nav a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
  transition: transform var(--transition-fast);
}

.nav-logo:hover {
  transform: scale(1.03);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-link-accent {
  text-decoration: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  transition: var(--transition-fast);
}

.nav-link-accent:hover {
  background-color: var(--primary-light);
  color: var(--primary-hover);
}

/* --------------------------------------------------------------------------
   4. BUTTON SYSTEM
   -------------------------------------------------------------------------- */
.btn-home,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  background: var(--primary-gradient);
  color: var(--text-inverse);
  text-decoration: none;
  box-shadow: 0 4px 14px var(--primary-glow);
  transition: var(--transition-normal);
}

.btn-home:hover,
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  color: #ffffff;
}

.btn-home:active,
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px var(--primary-glow);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-page);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow-md);
}

.btn-full {
  width: 100%;
}

.btn-pay {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.btn-pay:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
}

/* --------------------------------------------------------------------------
   5. HERO / MAIN CONTAINER
   -------------------------------------------------------------------------- */
.main-container {
  width: calc(100% - 2rem);
  max-width: 1280px;
  margin: 2.5rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 3rem;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.main-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(99, 102, 241, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 1050px;
  margin: 0 auto;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.15rem;
  background: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-pill);
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 1.75rem;
}

.hero-text {
  text-align: center;
  width: 100%;
}

.hero-text h1 {
  font-size: clamp(2.4rem, 4.8vw, 3.8rem);
  color: var(--text-main);
  margin-bottom: 1.5rem;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.hero-text h1 span {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text p {
  font-size: 1.25rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 850px;
  margin: 0 auto;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.hero-actions .btn-home {
  margin: 0;
  padding: 0.95rem 2rem;
  font-size: 1.05rem;
}

/* --------------------------------------------------------------------------
   6. AGITATION & SOLUTION SECTIONS
   -------------------------------------------------------------------------- */
.agitation-section,
.solution-section {
  max-width: 1280px;
  margin: 6rem auto;
  padding: 0 1.5rem;
}

.agitation-header,
.solution-header {
  max-width: 750px;
  margin: 0 auto 3.5rem;
  text-align: center;
}

.section-tag {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.agitation-header h2,
.solution-header h2 {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  margin-bottom: 1rem;
}

.solution-header h2 {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.agitation-header p,
.solution-header p {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.agitation-grid,
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.agitation-card,
.feature-card {
  padding: 2.25rem;
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.agitation-card:hover,
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(99, 102, 241, 0.3);
  background: var(--bg-glass-hover);
}

.icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  margin-bottom: 1.5rem;
  transition: transform var(--transition-fast);
}

.agitation-card:hover .icon,
.feature-card:hover .icon {
  transform: scale(1.1) rotate(-3deg);
}

.agitation-card h3,
.feature-card h3 {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

.feature-card h3 {
  color: var(--primary-hover);
}

.agitation-card p,
.feature-card p {
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.65;
}

/* --------------------------------------------------------------------------
   7. PRICING SECTION
   -------------------------------------------------------------------------- */
.pricing-section {
  max-width: 1280px;
  margin: 6rem auto;
  padding: 0 1.5rem;
}

.pricing-header {
  max-width: 750px;
  margin: 0 auto 3.5rem;
  text-align: center;
}

.pricing-header h2 {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  margin-bottom: 1rem;
}

.pricing-header p {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.pricing-card {
  max-width: 580px;
  margin: 0 auto;
  padding: 3.5rem 3rem;
  border-radius: var(--radius-xl);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px solid var(--primary);
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
}

.pricing-badge {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-gradient);
  color: var(--text-inverse);
  font-size: 0.85rem;
  font-weight: 800;
  padding: 0.4rem 1.25rem;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.pricing-title h3 {
  color: var(--text-subtle);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.price {
  color: var(--primary);
  font-size: clamp(3.2rem, 6vw, 4.2rem);
  font-weight: 900;
  margin-bottom: 2rem;
  line-height: 1;
}

.price span {
  display: block;
  font-size: 1rem;
  color: var(--text-subtle);
  font-weight: 600;
  margin-top: 0.75rem;
}

.pricing-features {
  list-style: none;
  text-align: left;
  margin: 0 auto 2.5rem;
  max-width: 420px;
}

.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 1.25rem;
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 600;
}

.pricing-features .check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--success-bg);
  color: var(--success);
  border-radius: 50%;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   8. FAQ SECTION
   -------------------------------------------------------------------------- */
.faq-section {
  max-width: 860px;
  margin: 6rem auto;
  padding: 0 1.5rem;
}

.faq-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.faq-header h2 {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
}

.faq-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.faq-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.faq-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.faq-item summary {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::after {
  content: "+";
  color: var(--primary);
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1;
  transition: transform var(--transition-normal);
}

.faq-item[open] summary::after {
  content: "−";
  transform: rotate(180deg);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item p {
  color: var(--text-muted);
  line-height: 1.75;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

/* --------------------------------------------------------------------------
   9. AUTHENTICATION & FORM STYLES
   -------------------------------------------------------------------------- */
.auth-main {
  min-height: calc(100vh - 180px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.auth-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 3.5rem 3rem;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
}

.auth-card h2 {
  text-align: center;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-bottom: 0.5rem;
}

.auth-card > p {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2.25rem;
}

.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
  letter-spacing: 0.2px;
}

.form-group input {
  font-family: inherit;
  padding: 0.9rem 1.15rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 1rem;
  background: var(--bg-surface);
  color: var(--text-main);
  transition: var(--transition-fast);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.auth-links {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.95rem;
}

.auth-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.auth-links a:hover {
  text-decoration: underline;
}

.auth-links p {
  color: var(--text-muted);
  margin-top: 1rem;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   10. DASHBOARD & LEARNING PROGRESS
   -------------------------------------------------------------------------- */
.dashboard-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 3rem;
  min-height: auto;
}

.dashboard-header {
  margin-bottom: 2.5rem;
  width: 100%;
}

.dashboard-header h1 {
  margin-bottom: 0.5rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
}

.dashboard-header p {
  color: var(--text-muted);
  font-size: 1.15rem;
}

.dashboard-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.progress-bar-bg {
  width: 100%;
  background-color: var(--border-light);
  border-radius: var(--radius-pill);
  height: 10px;
  margin: 1rem 0;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary-gradient);
  width: 0%;
  border-radius: var(--radius-pill);
  transition: width 0.5s ease;
}

/* --------------------------------------------------------------------------
   11. LESSON & QUIZ INTERFACE
   -------------------------------------------------------------------------- */
.lesson-card {
  max-width: 820px !important;
  width: 100%;
}

.module-badge {
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.quiz-container {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px dashed var(--border-light);
}

.quiz-container h3 {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quiz-question {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1.5rem;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

/* Decoupled Quiz Option Classes */
.quiz-option {
  width: 100%;
  padding: 1.1rem 1.5rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quiz-option:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateX(4px);
}

.quiz-option.correct {
  background: var(--success) !important;
  color: #ffffff !important;
  border-color: var(--success) !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.quiz-option.incorrect {
  background: var(--danger) !important;
  color: #ffffff !important;
  border-color: var(--danger) !important;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

/* --------------------------------------------------------------------------
   12. FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  background-color: #090d16;
  color: #e2e8f0;
  padding: 5rem 1.5rem 2.5rem;
  margin-top: 6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-container {
  max-width: 1280px;
  margin: auto;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 4rem;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 3.5rem;
}

.footer-brand {
  flex: 1;
  min-width: 280px;
  max-width: 400px;
}

.footer-logo {
  height: 42px;
  width: auto;
  margin-bottom: 1.5rem;
  display: block;
  filter: brightness(0) invert(1);
}

.footer-brand p {
  color: #94a3b8;
  line-height: 1.7;
}

.footer-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 2rem;
  flex: 2;
  min-width: 300px;
}

.footer-column h4 {
  color: #ffffff;
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
}

.footer-column ul {
  list-style: none;
}

.footer-column ul li {
  margin-bottom: 1rem;
}

.footer-column ul li a {
  color: #94a3b8;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-column ul li a:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 2.5rem;
  color: #64748b;
  font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   13. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .main-container {
    grid-template-columns: 1fr;
    padding: 2.5rem 2rem;
  }

  .hero-content {
    align-items: center;
    text-align: center;
  }

  .hero-text {
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
    width: 100%;
  }

}

@media (max-width: 768px) {
  /* Prevent fixed background attachment viewport height bugs on mobile Safari/Chrome */
  body {
    background-attachment: scroll;
  }

  header {
    margin: 0.5rem auto;
    width: calc(100% - 1rem);
  }

  .nav {
    padding: 0 1rem;
  }

  .main-container {
    padding: 2rem 1.25rem;
    margin: 1rem auto;
    width: calc(100% - 1rem);
  }

  .auth-main {
    min-height: calc(100dvh - 100px);
    padding: 1.5rem 1rem;
  }

  .auth-card,
  .pricing-card {
    padding: 2rem 1.25rem;
  }

  .agitation-section,
  .solution-section,
  .pricing-section,
  .faq-section {
    margin: 2.5rem auto;
    padding: 0 1rem;
  }

  .agitation-header,
  .solution-header,
  .pricing-header,
  .faq-header {
    margin-bottom: 1.75rem;
  }

  .course-main {
    margin: 1rem auto 2.5rem;
    padding: 0 1rem;
  }

  .legal-container {
    margin: 1.5rem auto 2rem;
    padding: 1.75rem 1.25rem;
    width: calc(100% - 1rem);
  }

  .footer-top {
    flex-direction: column;
    gap: 2rem;
  }
  
  .footer-links-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Topic navigation toolbar & mobile buttons fix */
  .topic-nav-row {
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
  }

  .topic-counter-badge {
    width: 100%;
    text-align: center;
    order: -1;
    margin-bottom: 0.25rem;
  }

  .topic-nav-row .btn-home {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 130px;
    justify-content: center;
    padding: 0.85rem 1rem;
    font-size: 0.92rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .agitation-section,
  .solution-section,
  .pricing-section,
  .faq-section {
    margin: 2rem auto;
  }

  .footer-links-grid {
    grid-template-columns: 1fr;
  }

  .topic-nav-row {
    flex-direction: column;
    align-items: stretch;
  }

  .topic-counter-badge {
    order: 1;
    align-self: center;
    width: auto;
  }

  .topic-nav-row .btn-home {
    width: 100%;
    order: 2;
    padding: 0.9rem 1.25rem;
    font-size: 0.95rem;
  }

  #prev-lesson-btn {
    order: 3;
  }

  .quiz-option {
    padding: 0.9rem 1.1rem;
    font-size: 0.93rem;
  }
}

/* --------------------------------------------------------------------------
   14. UTILITIES & DESIGN SYSTEM HELPER CLASSES
   -------------------------------------------------------------------------- */
.hidden {
  display: none !important;
}

.visible {
  display: inline-flex !important;
}

.btn-nav-cta {
  padding: 0.5rem 1.25rem !important;
  font-size: 0.9rem !important;
}

.btn-pricing-cta {
  font-size: 1.1rem !important;
  padding: 1.1rem !important;
}

.auth-card-highlight {
  border-color: var(--primary) !important;
}

.hero-badge-center {
  margin: 0 auto 1.25rem !important;
  display: table !important;
}

.badge-locked {
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  display: inline-block;
  margin-bottom: 0.75rem;
}

.badge-unlocked {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  display: inline-block;
  margin-bottom: 0.75rem;
}

.module-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.module-lessons-count {
  color: var(--text-muted);
}

.module-percentage {
  font-weight: 700;
  color: var(--primary);
}

.btn-card-action {
  margin-top: 1rem !important;
}

.lesson-body {
  margin-top: 1.5rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

.card-skeleton {
  opacity: 0.6;
}

.skeleton-progress-fill {
  width: 20%;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-subtle);
  margin-top: 0.35rem;
}



.explanation-box {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  background: var(--bg-glass-strong);
  border: 1px solid var(--border-subtle);
  font-size: 0.95rem;
  line-height: 1.6;
  transition: all 0.3s ease;
}

.explanation-box.correct {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.08);
}

.explanation-box.incorrect {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.explanation-header {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.explanation-box.correct .explanation-header {
  color: var(--success);
}

.explanation-box.incorrect .explanation-header {
  color: #ef4444;
}

.topic-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.topic-counter-badge {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
}

/* --------------------------------------------------------------------------
   15. TOAST NOTIFICATION SYSTEM
   -------------------------------------------------------------------------- */
#toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
  max-width: 400px;
  width: calc(100% - 3rem);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
  pointer-events: all;
  opacity: 0;
  transform: translateX(calc(100% + 2rem));
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.toast.toast-visible {
  opacity: 1;
  transform: translateX(0);
}

.toast.toast-hiding {
  opacity: 0;
  transform: translateX(calc(100% + 2rem));
}

.toast-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  margin-top: 1px;
}

.toast-message {
  flex: 1;
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.5;
  padding-top: 3px;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-subtle);
  font-size: 0.75rem;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color var(--transition-fast), background var(--transition-fast);
  line-height: 1;
  margin-top: 2px;
}

.toast-close:hover {
  color: var(--text-main);
  background: var(--border-light);
}

/* Toast Variants */
.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.06);
}

.toast-success .toast-icon {
  background: var(--success-bg);
  color: var(--success);
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.06);
}

.toast-error .toast-icon {
  background: var(--danger-bg);
  color: var(--danger);
}

.toast-warning {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.06);
}

.toast-warning .toast-icon {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.toast-info {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.05);
}

.toast-info .toast-icon {
  background: var(--primary-light);
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   16. INLINE FIELD ERROR STYLES
   -------------------------------------------------------------------------- */
.field-error {
  display: block;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 0.4rem;
  padding-left: 0.1rem;
  animation: fieldErrorFadeIn 0.2s ease;
}

.field-success {
  display: block;
  color: var(--success);
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 0.4rem;
  padding-left: 0.1rem;
  animation: fieldErrorFadeIn 0.2s ease;
}

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

.input-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

.input-success {
  border-color: var(--success) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12) !important;
}

@media (max-width: 480px) {
  #toast-container {
    top: auto;
    bottom: 1rem;
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    max-width: none;
  }

  .toast {
    transform: translateY(calc(100% + 2rem));
  }

  .toast.toast-visible {
    transform: translateY(0);
  }

  .toast.toast-hiding {
    transform: translateY(calc(100% + 2rem));
  }
}

/* --------------------------------------------------------------------------
   17. PASSWORD STRENGTH METER & SHOW/HIDE TOGGLE
   -------------------------------------------------------------------------- */

/* Wrapper positions the toggle button inside the input */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  width: 100%;
  /* extra right-padding so text doesn't sit under the toggle icon */
  padding-right: 3rem !important;
}

.password-toggle {
  position: absolute;
  right: 0.85rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-subtle);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
  line-height: 0;
}

.password-toggle:hover {
  color: var(--primary);
}

/* Strength meter row */
.strength-meter {
  margin-top: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.strength-segments {
  display: flex;
  gap: 5px;
  flex: 1;
}

.strength-segment {
  flex: 1;
  height: 5px;
  border-radius: var(--radius-pill);
  background: var(--border-light);
  transition: background 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.2s ease;
}

/* Segment fill colours */
.strength-segment.filled-weak    { background: var(--danger);  }
.strength-segment.filled-fair    { background: #f59e0b; }
.strength-segment.filled-good    { background: #3b82f6; }
.strength-segment.filled-strong  { background: var(--success); }

.strength-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  white-space: nowrap;
  min-width: 52px;
  text-align: right;
  transition: color 0.35s ease;
}

.strength-label.label-weak    { color: var(--danger); }
.strength-label.label-fair    { color: #d97706; }
.strength-label.label-good    { color: #2563eb; }
.strength-label.label-strong  { color: var(--success); }

/* --------------------------------------------------------------------------
   18. CHAPTER BREADCRUMB & CHAPTER-COMPLETE CARD
   -------------------------------------------------------------------------- */

/* Breadcrumb strip above the module badge */
.chapter-breadcrumb {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-subtle);
  text-transform: uppercase;
  padding: 0.35rem 0.7rem;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  display: inline-block;
  margin-bottom: 0.9rem;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Chapter-complete interstitial card */
.chapter-complete-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  padding: 2.5rem 1.5rem;
  background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(16,185,129,0.06));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  animation: fadeInUp 0.4s var(--ease-out) both;
}

.chapter-complete-icon {
  font-size: 3.5rem;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(99,102,241,0.3));
}

.chapter-complete-card h2 {
  margin: 0;
  font-size: 1.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.chapter-complete-sub {
  color: var(--text-subtle);
  font-size: 0.9rem;
  margin: 0;
  max-width: 340px;
}

.chapter-complete-card .btn-home {
  margin-top: 0.5rem;
  width: 100%;
  max-width: 360px;
}

/* --------------------------------------------------------------------------
   19. LEGAL PAGES (Terms, Privacy, Refund)
   -------------------------------------------------------------------------- */
.legal-container {
  width: calc(100% - 2rem);
  max-width: 900px;
  margin: 2.5rem auto 4rem auto;
  padding: 3.5rem 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  line-height: 1.7;
}

.legal-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.legal-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.legal-updated {
  font-size: 0.85rem;
  color: var(--text-subtle);
  font-weight: 600;
}

.legal-section {
  margin-bottom: 2rem;
}

.legal-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legal-section p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.legal-section ul {
  margin: 0.5rem 0 1rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.legal-section ul li {
  margin-bottom: 0.5rem;
  list-style-type: disc;
}

.legal-highlight-box {
  background: rgba(99, 102, 241, 0.05);
  border-left: 3px solid var(--primary);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin: 1rem 0;
  font-size: 0.92rem;
  color: var(--text-heading);
}

/* --------------------------------------------------------------------------
   20. AD ENGINE & MONETIZATION STYLES (POLISHED & RICH AESTHETICS)
   -------------------------------------------------------------------------- */

/* Badges */
.ad-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.25));
  color: #d97706;
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(245, 158, 11, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}

/* ── Fullscreen Interstitial Ad Modal ────────────────────────────────────── */
.ad-interstitial-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ad-interstitial-card {
  width: 100%;
  max-width: 500px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4),
              0 0 40px rgba(99, 102, 241, 0.15);
  padding: 2.25rem 2rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: scaleUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Animated Top Progress Bar */
.ad-progress-bar-track {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.ad-progress-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--gradient-primary);
  transition: width 3s linear;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.8);
}

.ad-interstitial-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ad-timer-pill {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-subtle);
  background: var(--bg-card-hover);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  transition: all 0.3s ease;
}

.ad-timer-pill.ready {
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.1);
}



.ad-interstitial-footer {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.25rem;
}

.ad-skip-button {
  width: 100%;
  justify-content: center;
  background: var(--bg-card-hover) !important;
  color: var(--text-heading) !important;
}

.ad-upgrade-btn {
  width: 100%;
  justify-content: center;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}

/* ── Polished Native Banner Ad ───────────────────────────────────────────── */
.ad-native-card {
  margin: 1.75rem 0;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.04), rgba(99, 102, 241, 0.04));
  border: 1px solid var(--border-glass);
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ad-native-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.12);
}



.ad-native-upgrade-link {
  font-size: 0.74rem;
  color: var(--text-subtle);
  text-decoration: underline;
  transition: color 0.2s ease;
}

.ad-native-upgrade-link:hover {
  color: var(--primary);
}

/* ── Floating Glassmorphic Sticky Bottom Ad Bar ──────────────────────────── */
.ad-sticky-bar {
  position: fixed;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 1.5rem);
  max-width: 960px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4),
              0 0 25px rgba(99, 102, 241, 0.2);
  padding: 0.65rem 1.25rem;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.ad-sticky-close {
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  font-size: 0.85rem;
  color: var(--text-heading);
  cursor: pointer;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
  z-index: 2;
}

.ad-sticky-close:hover {
  background: var(--primary);
  color: #ffffff;
  transform: scale(1.1);
}

.ad-sticky-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.ad-sticky-slot-wrapper {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.ad-sticky-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.ad-sticky-cta {
  white-space: nowrap;
  border-radius: var(--radius-pill) !important;
}

@media (max-width: 768px) {
  .ad-native-card {
    flex-direction: column;
    align-items: stretch;
  }
  .ad-native-right {
    align-items: stretch;
  }
  .ad-sticky-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    bottom: 0.5rem;
    padding: 0.4rem 0.75rem;
    width: calc(100% - 1rem);
    max-height: 70px;
    border-radius: var(--radius-lg);
    overflow: hidden;
  }
  .ad-sticky-content {
    width: auto;
    flex: 1;
    min-width: 0;
    justify-content: flex-start;
    gap: 0.5rem;
  }
  .ad-sticky-slot-wrapper {
    max-height: 50px;
    overflow: hidden;
    flex: 1;
  }
  .ad-sticky-slot-wrapper ins.adsbygoogle {
    max-height: 50px !important;
    height: 50px !important;
    overflow: hidden !important;
  }
  .ad-sticky-actions {
    width: auto;
    margin-top: 0;
  }
  .ad-sticky-actions .ad-sticky-cta {
    width: auto;
    padding: 0.35rem 0.65rem !important;
    font-size: 0.75rem !important;
    white-space: nowrap;
  }
  .ad-sticky-close {
    top: 2px;
    right: 4px;
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
  }
}

/* ==========================================================================
   21. COURSE TOPIC PICKER PAGE
   ========================================================================== */

/* ── Page Layout ─────────────────────────────────────────────────────────── */
.course-main {
  max-width: 860px;
  margin: 2rem auto 6rem;
  padding: 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── Course Overview Header Card ──────────────────────────────────────────── */
.course-overview-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.course-overview-card::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.07) 0%, transparent 70%);
  pointer-events: none;
}

.course-overview-content,
.course-overview-skeleton {
  display: flex;
  align-items: flex-start;
  gap: 1.75rem;
}

.course-overview-icon {
  font-size: 2.8rem;
  width: 72px;
  height: 72px;
  min-width: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.course-overview-info {
  flex: 1;
  min-width: 0;
}

.course-overview-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.course-overview-title {
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 1.25rem;
  line-height: 1.2;
}

.course-overall-progress {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.course-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}

.course-progress-pct {
  font-weight: 800;
  color: var(--primary);
}

/* ── Chapter Accordion Panel ──────────────────────────────────────────────── */
.chapter-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-normal);
}

.chapter-panel:hover {
  box-shadow: var(--shadow-md);
}

.chapter-panel-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
  font-family: inherit;
}

.chapter-panel-header:hover {
  background: var(--bg-card-hover);
}

.chapter-panel-header.open {
  border-bottom: 1px solid var(--border-light);
}

.chapter-panel-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.chapter-panel-num {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-subtle);
  background: var(--primary-light);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  flex-shrink: 0;
}

.chapter-panel-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.chapter-panel-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chapter-panel-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chapter-panel-count {
  font-size: 0.78rem;
  color: var(--text-subtle);
  font-weight: 600;
}

/* Chapter status badges */
.ch-status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
}

.ch-badge-complete {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.ch-badge-progress {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.ch-badge-new {
  background: var(--bg-card-hover);
  color: var(--text-subtle);
  border: 1px solid var(--border-light);
}

/* Right side: mini progress bar + chevron */
.chapter-panel-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.chapter-mini-progress {
  width: 70px;
  height: 5px;
  background: var(--border-light);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.chapter-mini-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: var(--radius-pill);
  transition: width 0.5s ease;
}

.chapter-panel-chevron {
  font-size: 1.1rem;
  color: var(--text-subtle);
  transition: transform var(--transition-normal);
  line-height: 1;
}

.chapter-panel-header.open .chapter-panel-chevron {
  transform: rotate(-180deg);
}

/* ── Accordion Body ──────────────────────────────────────────────────────── */
.chapter-panel-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease-out);
}

.chapter-panel-body.open {
  max-height: 3000px;
}

.topic-list {
  padding: 0.5rem 0;
}

/* ── Topic Row ───────────────────────────────────────────────────────────── */
.topic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.5rem;
  text-decoration: none;
  border-top: 1px solid var(--border-light);
  transition: background var(--transition-fast), transform var(--transition-fast);
  cursor: pointer;
}

.topic-row:first-child {
  border-top: none;
}

.topic-row:hover {
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.topic-row-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

/* Status icons */
.topic-status {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 800;
}

.topic-done {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border: 1.5px solid rgba(16, 185, 129, 0.3);
}

.topic-current {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
  border: 1.5px solid rgba(99, 102, 241, 0.3);
  animation: pulseCurrent 2s ease-in-out infinite;
}

@keyframes pulseCurrent {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.3); }
  50%       { box-shadow: 0 0 0 5px rgba(99, 102, 241, 0); }
}

.topic-todo {
  background: var(--bg-card-hover);
  color: var(--text-subtle);
  border: 1.5px solid var(--border-light);
}

.topic-row-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.topic-row-num {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-subtle);
}

.topic-row-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic-row-done .topic-row-title {
  color: var(--text-muted);
}

.topic-row-current .topic-row-title {
  color: var(--primary);
  font-weight: 700;
}

.topic-row-arrow {
  font-size: 1.25rem;
  color: var(--text-subtle);
  transition: transform var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}

.topic-row:hover .topic-row-arrow {
  transform: translateX(3px);
  color: var(--primary);
}

/* ── Chapter Panel Action Row (always visible — Start + Browse) ────────────── */
.chapter-panel-action {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.5rem;
  border-top: 1px solid var(--border-light);
  background: var(--bg-card);
}

.chapter-start-btn {
  flex: 1;
  justify-content: center;
  font-size: 0.9rem;
  padding: 0.7rem 1rem;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .course-overview-content,
  .course-overview-skeleton {
    flex-direction: column;
    gap: 1rem;
  }

  .course-overview-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    font-size: 2.1rem;
  }

  .chapter-panel-title {
    font-size: 0.9rem;
  }

  .chapter-mini-progress {
    display: none;
  }

  .topic-row {
    padding: 0.85rem 1rem;
  }

  .chapter-panel-header {
    padding: 1.1rem 1rem;
  }

  .chapter-panel-footer {
    padding: 1rem;
  }
}

/* ==========================================================================
   22. ADMIN CMS PANEL
   ========================================================================== */

/* ── Body override: no footer, full-height shell ──────────────────────────── */
.admin-body {
  min-height: 100vh;
  background: var(--bg-page);
  display: flex;
  flex-direction: column;
}

/* ── Two-column shell ──────────────────────────────────────────────────────── */
.admin-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.admin-sidebar {
  width: 260px;
  min-width: 260px;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.admin-sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.admin-sidebar-logo {
  font-size: 1.6rem;
}

.admin-sidebar-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: #f1f5f9;
}

.admin-sidebar-sub {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.1rem;
  word-break: break-all;
}

.admin-nav {
  flex: 1;
  padding: 1rem 0.75rem;
}

.admin-nav-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #475569;
  padding: 0 0.5rem;
  margin-bottom: 0.5rem;
}

.admin-course-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.admin-course-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: #94a3b8;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.admin-course-item:hover {
  background: rgba(255,255,255,0.06);
  color: #f1f5f9;
}

.admin-course-item.active {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.admin-course-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.admin-course-skeleton {
  color: #334155;
  font-size: 0.82rem;
  cursor: default;
  font-style: italic;
}

.admin-add-course-btn {
  width: 100%;
  padding: 0.65rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1.5px dashed rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-md);
  color: #818cf8;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.admin-add-course-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.6);
}

.admin-sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-sidebar-link {
  font-size: 0.82rem;
  color: #64748b;
  text-decoration: none;
  transition: color var(--transition-fast);
}
.admin-sidebar-link:hover { color: #94a3b8; }

/* ── Main content area ─────────────────────────────────────────────────────── */
.admin-main {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.admin-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-subtle);
  gap: 0.75rem;
}

.admin-empty-icon { font-size: 3rem; }

/* ── Panel ──────────────────────────────────────────────────────────────────── */
.admin-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.admin-panel.hidden { display: none; }

.admin-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-panel-breadcrumb {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-subtle);
  margin-bottom: 0.25rem;
}

.admin-panel-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-heading);
  margin: 0;
}

.admin-panel-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Section (chapters list, topics list) ──────────────────────────────────── */
.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card-hover);
}

.admin-section-header h3 {
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-heading);
  margin: 0;
}

/* ── Item list rows ─────────────────────────────────────────────────────────── */
.admin-item-list {
  display: flex;
  flex-direction: column;
}

.admin-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
}

.admin-item-row:last-child { border-bottom: none; }
.admin-item-row:hover { background: var(--bg-card-hover); }

.admin-item-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  min-width: 0;
}

.admin-item-order {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-subtle);
  background: var(--primary-light);
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  flex-shrink: 0;
}

.admin-item-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-item-meta {
  font-size: 0.78rem;
  color: var(--text-subtle);
}

.admin-item-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.admin-loading, .admin-error, .admin-empty-inline {
  padding: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-subtle);
}

.admin-error { color: var(--danger); }

/* ── Form card ────────────────────────────────────────────────────────────── */
.admin-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.admin-form-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-heading);
  margin: 0 0 0.25rem 0;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-light);
}

.admin-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  display: block;
  margin-top: 0.25rem;
}

.admin-label-required {
  color: var(--danger);
  margin-left: 0.15rem;
}

.admin-input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-sizing: border-box;
}

.admin-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.admin-textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-sizing: border-box;
}

.admin-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.admin-form-actions {
  display: flex;
  gap: 0.65rem;
  padding-top: 0.5rem;
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.admin-btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}
.admin-btn-primary:hover {
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

.admin-btn-ghost {
  background: var(--bg-card-hover);
  color: var(--text-muted);
  border-color: var(--border-light);
}
.admin-btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.admin-btn-danger {
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.25);
}
.admin-btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--danger);
}

.admin-btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
}

.admin-btn-lg {
  padding: 0.8rem 1.5rem;
  font-size: 0.95rem;
}

/* ── Topic editor ───────────────────────────────────────────────────────────── */
.admin-topic-editor {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.admin-topic-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Quiz option editor rows */
.quiz-options-editor {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quiz-option-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.option-label {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card-hover);
  border: 1.5px solid var(--border-light);
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.quiz-option-row .admin-input,
.quiz-option-row .admin-textarea {
  flex: 1;
}

/* ── Modals ─────────────────────────────────────────────────────────────────── */
.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.admin-modal-backdrop.hidden { display: none; }

.admin-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.admin-modal h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-heading);
  margin: 0 0 0.5rem 0;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-light);
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .admin-shell { flex-direction: column; height: auto; }
  .admin-sidebar { width: 100%; min-width: 0; height: auto; }
  .admin-main { padding: 1rem; }
  .admin-panel-header { flex-direction: column; }
  .admin-panel-title { font-size: 1.2rem; }
}

/* ==========================================================================
   23. MIGRATION TOOL PAGE
   ========================================================================== */

.migrate-step-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  background: var(--bg-card);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.migrate-step-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.migrate-step-header h2 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-heading);
}

.migrate-step-num {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.migrate-status {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.status-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-error {
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-info {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.migrate-log {
  background: #0f172a;
  color: #94a3b8;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(255,255,255,0.06);
  line-height: 1.6;
}

.migrate-log-line { white-space: pre-wrap; }
.log-success { color: #34d399; }
.log-error   { color: #f87171; }

/* ==========================================================================
   24. SKELETON LOADERS & SHIMMER ANIMATIONS
   ========================================================================== */

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

.skeleton-box {
  background: linear-gradient(
    90deg,
    var(--bg-card-hover) 25%,
    var(--border-light) 37%,
    var(--bg-card-hover) 63%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
  display: block;
}

.skeleton-text {
  height: 0.85rem;
  margin-bottom: 0.5rem;
  border-radius: 4px;
}

.skeleton-title {
  height: 1.4rem;
  width: 60%;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-sm);
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.skeleton-button {
  height: 2.5rem;
  width: 100%;
  border-radius: var(--radius-md);
}

.dashboard-card-skeleton {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.chapter-panel-skeleton {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   25. SEARCH SYSTEM (DASHBOARD & LESSON)
   ========================================================================== */
.search-container {
  width: 100%;
  max-width: 650px;
  margin: 1.5rem auto 2rem auto;
  position: relative;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 1.25rem;
  font-size: 1.1rem;
  color: var(--text-subtle);
  pointer-events: none;
  z-index: 2;
}

.search-input {
  width: 100%;
  padding: 0.95rem 3rem 0.95rem 3.1rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  outline: none;
  transition: all var(--transition-normal);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow), var(--shadow-lg);
  background: var(--bg-glass-strong);
}

.search-clear-btn {
  position: absolute;
  right: 1.1rem;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  transition: all 0.2s ease;
  z-index: 2;
}

.search-clear-btn:hover {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 0.65rem);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-glass);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
  max-height: 380px;
  overflow-y: auto;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: 0.6rem;
  gap: 0.4rem;
  animation: fadeIn 0.2s ease;
}

.search-dropdown.hidden {
  display: none !important;
}

.search-result-group-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-subtle);
  padding: 0.5rem 0.85rem 0.25rem;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-main);
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.search-result-item:hover {
  background: var(--primary-light);
  border-color: var(--primary-hover);
  transform: translateX(3px);
}

.search-result-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  min-width: 0;
}

.search-result-icon {
  font-size: 1.4rem;
  width: 38px;
  height: 38px;
  min-width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.search-result-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.search-result-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-meta {
  font-size: 0.78rem;
  color: var(--text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-arrow {
  color: var(--primary);
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.search-no-results {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-subtle);
  font-size: 0.92rem;
  font-weight: 600;
}

.lesson-search-container {
  margin: 1rem 0;
  width: 100%;
}

@media (max-width: 768px) {
  .search-container {
    margin: 1rem auto 1.5rem auto;
  }
  
  .search-input {
    padding: 0.85rem 2.6rem 0.85rem 2.8rem;
    font-size: 0.92rem;
  }

  .search-result-item {
    padding: 0.75rem 0.85rem;
  }

  .search-result-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 1.1rem;
  }
}

/* ==========================================================================
   26. CONTENT VISIBILITY TOGGLE (HIDE / UNHIDE)
   ========================================================================== */
.lesson-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.btn-toggle-content {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.btn-toggle-content:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-glass);
  transform: translateY(-1px);
}

.btn-toggle-content.content-hidden-active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-hover);
}