/* ============================================================
   EduGuru Design System — Liquid Glass / Glassmorphism
   Mobile-First | 375px base | Inter/Poppins
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@400;500;600;700;800&display=swap');

/* ── CSS VARIABLES ────────────────────────────────────────── */
:root {
  /* Colors */
  --white:          #FFFFFF;
  --black:          #111111;
  --gray-50:        #F8F9FF;
  --gray-100:       #F0F2FF;
  --gray-200:       #E4E8FF;
  --gray-300:       #C8CFEE;
  --gray-400:       #9DA8C7;
  --gray-500:       #6B7599;
  --gray-600:       #4A5270;

  /* Royal Purple Gradient */
  --purple-start:   #480192;
  --purple-end:     #925ef8;
  --gradient:       linear-gradient(135deg, #480192 0%, #925ef8 100%);
  --gradient-soft:  linear-gradient(135deg, rgba(72,1,146,0.12) 0%, rgba(146,94,248,0.12) 100%);
  --gradient-hover: linear-gradient(135deg, #5601AA 0%, #A370FF 100%);

  /* Glassmorphism */
  --glass-bg:       rgba(255, 255, 255, 0.72);
  --glass-bg-dark:  rgba(255, 255, 255, 0.55);
  --glass-border:   rgba(255, 255, 255, 0.5);
  --glass-shadow:   0 8px 32px rgba(72, 1, 146, 0.12);
  --glass-shadow-lg:0 16px 48px rgba(72, 1, 146, 0.18);
  --blur:           blur(10px);
  --blur-sm:        blur(6px);

  /* Spacing */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;

  /* Border radius */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --radius-2xl:  24px;
  --radius-full: 9999px;

  /* Typography */
  --font-body:     'Inter', sans-serif;
  --font-display:  'Poppins', sans-serif;

  /* Font sizes */
  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 15px;
  --text-md:   16px;
  --text-lg:   18px;
  --text-xl:   20px;
  --text-2xl:  24px;
  --text-3xl:  28px;
  --text-4xl:  32px;

  /* Transitions */
  --transition: all 0.3s ease;
  --transition-fast: all 0.15s ease;
  --transition-spring: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index layers */
  --z-base:    1;
  --z-card:    10;
  --z-sticky:  100;
  --z-nav:     200;
  --z-overlay: 300;
  --z-modal:   400;
  --z-toast:   500;

  /* Layout */
  --topbar-h:   60px;
  --bottomnav-h: 68px;
  --max-w:      100%;   /* mobile-first: full width by default; overridden at 768px+ */
}

/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--black);
  background: var(--gray-50);
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(106,17,203,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(37,117,252,0.06) 0%, transparent 60%);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }

/* Desktop right panel — hidden by default, shown via desktop media query */
#desktop-right-panel { display: none; }

/* ── APP CONTAINER ────────────────────────────────────────── */
#app {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  background: var(--white);
  display: flex;
  flex-direction: column;
}

/* ── SCROLLABLE CONTENT AREA ──────────────────────────────── */
#page-content {
  flex: 1;
  padding-top: var(--topbar-h);
  padding-bottom: calc(var(--bottomnav-h) + 20px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overflow-x: hidden;
  /* No min-height — flex:1 fills remaining space cleanly */
}

/* ── TOP APP BAR ──────────────────────────────────────────── */
.top-bar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  height: var(--topbar-h);
  background: var(--glass-bg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  z-index: var(--z-nav);
  box-shadow: 0 2px 20px rgba(106,17,203,0.08);
  will-change: transform;
}

.top-bar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

.top-bar__logo {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.top-bar__logo img { width: 42px; height: 42px; object-fit: contain; display: block; border-radius: 10px; }

.top-bar__logo svg { width: 18px; height: 18px; color: white; }

.top-bar__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

.top-bar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--glass-bg-dark);
  backdrop-filter: var(--blur-sm);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: var(--transition);
  color: var(--gray-600);
}

.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }

.notification-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 9px;
  height: 9px;
  border-radius: var(--radius-full);
  background: var(--gradient);
  border: 2px solid var(--white);
}

/* ── BOTTOM NAV BAR ───────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: calc(var(--max-w) - 32px);
  height: 64px;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 6px;
  z-index: var(--z-nav);
  box-shadow:
    0 8px 32px rgba(106,17,203,0.12),
    0 2px 8px rgba(0,0,0,0.06),
    inset 0 1px 0 rgba(255,255,255,0.95);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
  padding: 7px 4px;
  border-radius: 20px;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  color: #A0A8BB;
  position: relative;
  cursor: pointer;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  z-index: 1;
}

.nav-item span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  z-index: 1;
}

/* Active: gradient pill via ::before so flex layout never shifts */
.nav-item.active:not(.nav-item--create) {
  color: #fff;
}

.nav-item.active:not(.nav-item--create)::before {
  content: '';
  position: absolute;
  inset: 2px 6px;
  background: var(--gradient);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(72,1,146,0.35), 0 1px 4px rgba(146,94,248,0.25);
  z-index: 0;
}

.nav-item.active:not(.nav-item--create) svg {
  stroke: #fff !important;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.25));
}

.nav-item.active:not(.nav-item--create) span {
  color: #fff;
  -webkit-text-fill-color: #fff;
  font-weight: 700;
}

.nav-item--create.active::before {
  display: none;
}

/* Create nav item (center) */
.nav-item--create {
  flex: 0 0 56px;
  justify-content: center;
}

.nav-item--create .nav-create-btn {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(72,1,146,0.4);
  transition: var(--transition-spring);
}

.nav-item--create .nav-create-btn svg {
  stroke: white;
  fill: none;
  width: 22px;
  height: 22px;
  stroke-width: 2.5;
}

.nav-item--create:active .nav-create-btn {
  transform: scale(0.88);
}

/* Create button — active/selected state */
.nav-item--create.active .nav-create-btn {
  background: linear-gradient(135deg, #00C896, #059669);
  box-shadow: 0 0 0 3px rgba(0,200,150,0.25), 0 0 0 6px rgba(5,150,105,0.12), 0 6px 24px rgba(0,200,150,0.50);
  transform: scale(1.12);
  animation: createPulse 2s ease-in-out infinite;
}

@keyframes createPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(0,200,150,0.25), 0 0 0 6px rgba(5,150,105,0.12), 0 6px 24px rgba(0,200,150,0.50); }
  50%       { box-shadow: 0 0 0 5px rgba(0,200,150,0.18), 0 0 0 10px rgba(5,150,105,0.08), 0 8px 32px rgba(0,200,150,0.65); }
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.75; }
}

/* Live dot animations */
@keyframes dotRed {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.7); }
  50%       { box-shadow: 0 0 0 5px rgba(239,68,68,0); }
}
@keyframes dotGreen {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.7); }
  50%       { box-shadow: 0 0 0 5px rgba(16,185,129,0); }
}



/* ── GLASS CARD ───────────────────────────────────────────── */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--glass-shadow);
}

.glass-card--flat {
  backdrop-filter: none;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-xl);
  box-shadow: 0 2px 12px rgba(106,17,203,0.06);
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  border-radius: var(--radius-full);
  padding: 12px 24px;
  transition: var(--transition-spring);
  cursor: pointer;
  border: none;
  outline: none;
  position: relative;
  overflow: hidden;
  user-select: none;
  white-space: nowrap;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: var(--transition-fast);
}

.btn:active::after { background: rgba(255,255,255,0.15); }

.btn-primary {
  background: var(--gradient);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(106,17,203,0.35);
}

.btn-primary:hover { box-shadow: 0 6px 24px rgba(106,17,203,0.45); transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.96) translateY(0); box-shadow: 0 2px 8px rgba(106,17,203,0.3); }

.btn-outline {
  background: transparent;
  color: var(--purple-start);
  border: 2px solid var(--purple-start);
}

.btn-outline:hover { background: var(--gradient-soft); }
.btn-outline:active { transform: scale(0.96); }

.btn-ghost {
  background: var(--glass-bg);
  color: var(--gray-600);
  border: 1px solid var(--glass-border);
}

.btn-ghost:active { transform: scale(0.96); }

.btn-danger {
  background: linear-gradient(135deg, #FF416C, #FF4B2B);
  color: white;
  box-shadow: 0 4px 16px rgba(255,65,108,0.3);
}

.btn-success {
  background: linear-gradient(135deg, #11CB6A, #0A9E52);
  color: white;
  box-shadow: 0 4px 16px rgba(17,203,106,0.3);
}

.btn--sm { padding: 8px 16px; font-size: var(--text-xs); }
.btn--lg { padding: 16px 32px; font-size: var(--text-md); }
.btn--full { width: 100%; }
.btn--icon { padding: 12px; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ── FORMS ────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-md);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-600);
  letter-spacing: 0.2px;
}

.form-label .required { color: #FF416C; margin-left: 2px; }

.form-input {
  width: 100%;
  height: 52px;
  padding: 0 var(--space-md);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--gray-200);
  background: var(--glass-bg);
  backdrop-filter: var(--blur-sm);
  font-size: var(--text-base);
  color: var(--black);
  transition: var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--purple-start);
  box-shadow: 0 0 0 3px rgba(106,17,203,0.12);
  background: var(--white);
}

.form-input::placeholder { color: var(--gray-400); }
.form-input.error { border-color: #FF416C; box-shadow: 0 0 0 3px rgba(255,65,108,0.12); }
.form-input.success { border-color: #11CB6A; }

.form-textarea {
  width: 100%;
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--gray-200);
  background: var(--glass-bg);
  font-size: var(--text-base);
  color: var(--black);
  resize: vertical;
  min-height: 100px;
  outline: none;
  transition: var(--transition);
  line-height: 1.6;
}

.form-textarea:focus {
  border-color: var(--purple-start);
  box-shadow: 0 0 0 3px rgba(106,17,203,0.12);
}

.form-select {
  width: 100%;
  height: 52px;
  padding: 0 var(--space-md);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  font-size: var(--text-base);
  color: var(--black);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7599' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
  transition: var(--transition);
}

.form-select:focus {
  border-color: var(--purple-start);
  box-shadow: 0 0 0 3px rgba(106,17,203,0.12);
}

.form-error {
  font-size: var(--text-xs);
  color: #FF416C;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--gray-400);
}

/* Input with icon */
.input-wrap {
  position: relative;
}

.input-wrap .input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  stroke: var(--gray-400);
  fill: none;
  stroke-width: 2;
  pointer-events: none;
}

.input-wrap .form-input { padding-left: 44px; }

.input-wrap .input-icon-right {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  stroke: var(--gray-400);
  fill: none;
  stroke-width: 2;
  cursor: pointer;
  width: 20px;
  height: 20px;
}

/* ── COURSE CARD ──────────────────────────────────────────── */
.course-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-100);
  box-shadow: 0 2px 12px rgba(106,17,203,0.06);
  overflow: hidden;
  transition: var(--transition-spring);
  cursor: pointer;
  position: relative;
  contain: layout style;
}

.course-card:active { transform: scale(0.97); box-shadow: none; }

.course-card__thumb {
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
  /* Shimmer while image loads — gets covered once img opacity reaches 1 */
  background: linear-gradient(110deg, #ede7f6 30%, #d8c8f8 50%, #ede7f6 70%);
  background-size: 200% 100%;
  animation: _cardThumbShimmer 1.6s linear infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
@keyframes _cardThumbShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.course-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-card__thumb-placeholder {
  width: 100%;
  aspect-ratio: 3/2;
  background: var(--gradient-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.course-card__thumb-placeholder svg {
  width: 36px;
  height: 36px;
  stroke: rgba(106,17,203,0.3);
  fill: none;
}

.course-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  backdrop-filter: var(--blur-sm);
}

.badge-fire {
  background: linear-gradient(135deg, #FF416C, #FF8A00);
  color: white;
}

.badge-discount {
  background: linear-gradient(135deg, #11CB6A, #0A9E52);
  color: white;
}

.badge-new {
  background: var(--gradient);
  color: white;
}

.course-card__body {
  padding: 12px var(--space-md);
}

.course-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--black);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.course-card__teacher {
  font-size: var(--text-xs);
  color: var(--gray-500);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.course-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 10px;
}

.course-card__rating {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: #F59E0B;
}

.course-card__enrolls {
  font-size: var(--text-xs);
  color: var(--gray-400);
  display: flex;
  align-items: center;
  gap: 3px;
}

.course-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.course-card__price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-md);
  color: var(--black);
}

.course-card__price .original-price {
  font-size: var(--text-xs);
  color: var(--gray-400);
  text-decoration: line-through;
  font-weight: 400;
  margin-left: 4px;
}

.course-card__cta {
  padding: 6px 14px;
  font-size: 11px;
  border-radius: var(--radius-full);
  background: var(--gradient);
  color: white;
  font-weight: 700;
  transition: var(--transition-spring);
  border: none;
  cursor: pointer;
}

.course-card__cta:active { transform: scale(0.92); }

.course-card__cta.enrolled {
  background: var(--gradient-soft);
  color: var(--purple-start);
  border: 1.5px solid rgba(106,17,203,0.2);
}

/* ── COURSE GRID ──────────────────────────────────────────── */
.courses-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  padding: 0 var(--space-md);
}

/* ── SKELETON LOADER ──────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.skeleton {
  background: linear-gradient(90deg,
    var(--gray-100) 25%,
    var(--gray-200) 50%,
    var(--gray-100) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-100);
  overflow: hidden;
}

.skeleton-thumb {
  width: 100%;
  aspect-ratio: 3/2;
}

.skeleton-body { padding: 12px var(--space-md); }
.skeleton-line { height: 12px; margin-bottom: 8px; border-radius: var(--radius-full); }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-40 { width: 40%; }

/* ── SEARCH BAR ───────────────────────────────────────────── */
.search-wrap {
  position: relative;
  padding: var(--space-md);
}

.search-bar {
  width: 100%;
  height: 52px;
  padding: 0 110px 0 48px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--gray-200);
  background: var(--glass-bg);
  backdrop-filter: var(--blur);
  font-size: var(--text-base);
  color: var(--black);
  outline: none;
  transition: var(--transition);
  box-shadow: var(--glass-shadow);
}

.search-bar:focus {
  border-color: var(--purple-start);
  box-shadow: 0 0 0 3px rgba(106,17,203,0.12), var(--glass-shadow);
}

.search-bar::placeholder { color: var(--gray-400); }

.search-icon {
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  stroke: var(--gray-400);
  fill: none;
  stroke-width: 2.2;
  pointer-events: none;
  transition: var(--transition);
}

.search-bar:focus + .search-icon { stroke: var(--purple-start); }

.search-btn {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  background: var(--gradient);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-body);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.search-btn:active { opacity: 0.8; }
.search-btn svg { width: 14px; height: 14px; stroke: #fff; fill: none; stroke-width: 2.2; flex-shrink: 0; }

.search-clear {
  position: absolute;
  right: 110px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  display: none;
}

.search-clear svg { width: 12px; height: 12px; stroke: var(--gray-500); stroke-width: 2.5; }

/* Search Dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% - var(--space-md));
  left: var(--space-md);
  right: var(--space-md);
  background: var(--glass-bg);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow-lg);
  z-index: var(--z-overlay);
  overflow: hidden;
  display: none;
}

.search-dropdown.show { display: block; }

.search-dropdown__header {
  padding: 12px var(--space-md) 6px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--gray-400);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.search-history-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-md);
  cursor: pointer;
  transition: var(--transition-fast);
}

.search-history-item:hover { background: var(--gradient-soft); }
.search-history-item svg { width: 14px; height: 14px; stroke: var(--gray-400); fill: none; flex-shrink: 0; }
.search-history-item span { font-size: var(--text-sm); color: var(--black); flex: 1; }
.search-history-item .delete-history { stroke: var(--gray-300); margin-left: auto; cursor: pointer; }

/* ── TABS ─────────────────────────────────────────────────── */
.tabs-wrap {
  padding: 0 var(--space-md);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tabs-wrap::-webkit-scrollbar { display: none; }

.tabs {
  display: flex;
  gap: var(--space-sm);
  min-width: max-content;
  padding-bottom: 2px;
}

.tab-btn {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-500);
  background: var(--gray-100);
  border: none;
  cursor: pointer;
  transition: var(--transition-spring);
  white-space: nowrap;
}

.tab-btn.active {
  background: var(--gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(106,17,203,0.3);
}

.tab-btn:active { transform: scale(0.95); }

/* ── SECTION HEADER ───────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-md) var(--space-sm);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--black);
}

.section-link {
  font-size: var(--text-sm);
  font-weight: 600;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── FEATURED SPOTLIGHT CAROUSEL ─────────────────────────── */
.feature-wrap {
  padding: var(--space-md);
  position: relative;
}

.feature-reel {
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/9;
  box-shadow: var(--glass-shadow);
}

.feature-slides { display: flex; transition: transform 0.4s ease; height: 100%; }

.feature-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
  cursor: pointer;
}

.feature-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature-slide .feature-placeholder {
  width: 100%;
  height: 100%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: white;
}

.feature-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.feature-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--gray-300);
  transition: var(--transition);
  cursor: pointer;
}

.feature-dot.active {
  background: var(--gradient);
  width: 20px;
}

/* ── CATEGORY GRID ────────────────────────────────────────── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  padding: 0 var(--space-md);
}

.category-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-xl);
  padding: var(--space-md) var(--space-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-spring);
  text-align: center;
  box-shadow: 0 2px 8px rgba(106,17,203,0.05);
}

.category-card:active { transform: scale(0.94); }

.category-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--gradient-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.category-name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--black);
  line-height: 1.3;
}

/* ── NOTIFICATION PANEL ───────────────────────────────────── */
.notif-panel {
  position: fixed;
  top: var(--topbar-h);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: calc(100% - 32px);
  max-width: calc(var(--max-w) - 32px);
  background: var(--glass-bg);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow-lg);
  z-index: var(--z-overlay);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  max-height: 60vh;
  overflow-y: auto;
}

.notif-panel.show {
  opacity: 1;
  transform: translateX(-50%) translateY(8px);
  pointer-events: all;
}

.notif-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--gray-100);
  position: sticky;
  top: 0;
  background: var(--glass-bg);
  backdrop-filter: var(--blur);
}

.notif-panel__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-md);
}

.notif-item {
  display: flex;
  gap: var(--space-md);
  padding: 12px var(--space-md);
  border-bottom: 1px solid var(--gray-100);
  transition: var(--transition-fast);
  cursor: pointer;
}

.notif-item:hover { background: var(--gradient-soft); }
.notif-item.unread { background: rgba(106,17,203,0.03); }

.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--gradient-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-icon svg { width: 16px; height: 16px; stroke: var(--purple-start); fill: none; stroke-width: 2; }

.notif-content .notif-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--black);
}

.notif-content .notif-msg {
  font-size: var(--text-xs);
  color: var(--gray-500);
  margin-top: 2px;
  line-height: 1.4;
}

.notif-content .notif-time {
  font-size: 10px;
  color: var(--gray-400);
  margin-top: 4px;
}

/* ── TOAST MESSAGES ───────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: calc(var(--bottomnav-h) + 16px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: calc(var(--max-w) - 32px);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  background: var(--black);
  color: white;
  padding: 12px var(--space-md);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  pointer-events: all;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.toast-success { background: linear-gradient(135deg, #0A9E52, #11CB6A); }
.toast.toast-error   { background: linear-gradient(135deg, #FF416C, #FF4B2B); }
.toast.toast-info    { background: var(--gradient); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(8px) scale(0.95); }
}

/* ── MODAL ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.modal-sheet {
  width: 100%;
  max-width: var(--max-w);
  background: var(--white);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  padding: var(--space-lg);
  padding-bottom: calc(var(--space-xl) + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 85vh;
  overflow-y: auto;
  will-change: transform;
}

.modal-overlay.show .modal-sheet {
  transform: translateY(0);
}

.modal-sheet__handle {
  width: 36px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--gray-200);
  margin: -8px auto var(--space-lg);
}

.modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  color: var(--black);
  margin-bottom: var(--space-lg);
}

/* ── CHIPS ────────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--gray-100);
  color: var(--gray-600);
}

.chip-purple {
  background: var(--gradient-soft);
  color: var(--purple-start);
  border: 1px solid rgba(106,17,203,0.15);
}

.chip-green {
  background: #DCFCE7;
  color: #166534;
  border: 1px solid #BBF7D0;
}

.chip-red {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.chip-amber {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}

/* ── SERIAL ID CHIP ───────────────────────────────────────── */
.eg-id {
  display: inline-flex; align-items: center; gap: 4px;
  background: #EDE9FE; color: #6A11CB;
  font-family: monospace; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px; cursor: pointer;
  border: 1px solid #DDD6FE; user-select: none;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.eg-id:hover { background: #DDD6FE; }
.eg-id:active { transform: scale(0.95); }
.eg-id::after { content: '📋'; font-size: 9px; opacity: 0.6; }
.eg-id--copied { background: #D1FAE5 !important; color: #059669 !important; border-color: #6EE7B7 !important; transform: scale(1.05); }
.eg-id--copied::after { content: '✓' !important; opacity: 1; }

/* ── AVATAR ───────────────────────────────────────────────── */
.avatar {
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--gradient-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--purple-start);
  flex-shrink: 0;
}

.avatar-sm  { width: 32px; height: 32px; font-size: var(--text-sm); }
.avatar-md  { width: 44px; height: 44px; font-size: var(--text-md); }
.avatar-lg  { width: 56px; height: 56px; font-size: var(--text-xl); }
.avatar-xl  { width: 80px; height: 80px; font-size: var(--text-2xl); }

/* ── STAR RATING ──────────────────────────────────────────── */
.stars {
  display: flex;
  gap: 2px;
}

.star {
  width: 14px;
  height: 14px;
  color: #F59E0B;
}

.star.filled { fill: #F59E0B; }
.star.half   { fill: url(#halfGrad); }
.star.empty  { fill: var(--gray-200); }

/* ── PROGRESS BAR ─────────────────────────────────────────── */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

/* ── DIVIDER ──────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--gray-100);
  margin: var(--space-md) 0;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--gray-400);
  font-size: var(--text-xs);
  font-weight: 500;
  margin: var(--space-lg) 0;
}

.divider-text::before, .divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* ── EMPTY STATE ──────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
}

.empty-state__icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--gradient-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state__icon svg {
  width: 36px;
  height: 36px;
  stroke: var(--purple-start);
  fill: none;
  stroke-width: 1.5;
}

.empty-state__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  color: var(--black);
}

.empty-state__text {
  font-size: var(--text-sm);
  color: var(--gray-500);
  line-height: 1.6;
  max-width: 240px;
}

/* ── PAGE TRANSITION ──────────────────────────────────────── */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page {
  animation: pageIn 0.3s ease;
}

/* ── ACCORDION ────────────────────────────────────────────── */
.accordion-item {
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-sm);
  overflow: hidden;
  transition: var(--transition);
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  cursor: pointer;
  background: var(--white);
  transition: var(--transition-fast);
}

.accordion-header:hover { background: var(--gray-50); }

.accordion-title {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--black);
  flex: 1;
}

.accordion-icon {
  width: 18px;
  height: 18px;
  stroke: var(--gray-400);
  fill: none;
  transition: transform 0.3s ease;
}

.accordion-item.open .accordion-icon { transform: rotate(180deg); }

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.accordion-body.open { max-height: 2000px; }

.accordion-content {
  padding: 0 var(--space-md) var(--space-md);
  border-top: 1px solid var(--gray-100);
}

/* ── LESSON ITEM ──────────────────────────────────────────── */
.lesson-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
}

.lesson-item:last-child { border-bottom: none; }

.lesson-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--gradient-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lesson-icon svg { width: 14px; height: 14px; stroke: var(--purple-start); fill: none; stroke-width: 2; }
.lesson-icon.locked { background: var(--gray-100); }
.lesson-icon.locked svg { stroke: var(--gray-400); }

.lesson-info { flex: 1; min-width: 0; }
.lesson-title { font-size: var(--text-sm); font-weight: 500; color: var(--black); }
.lesson-meta  { font-size: var(--text-xs); color: var(--gray-400); margin-top: 2px; }
.lesson-free-tag { font-size: 10px; font-weight: 700; color: var(--purple-start); background: var(--gradient-soft); padding: 2px 8px; border-radius: var(--radius-full); }

/* ── HORIZONTAL SCROLL ROW ────────────────────────────────── */
.scroll-row {
  display: flex;
  gap: var(--space-md);
  padding: 0 var(--space-md);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
}

.scroll-row::-webkit-scrollbar { display: none; }

.scroll-row .course-card {
  min-width: 180px;
  scroll-snap-align: start;
}

/* ── UTILITIES ────────────────────────────────────────────── */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.flex-1 { flex: 1; }

.text-sm   { font-size: var(--text-sm); }
.text-xs   { font-size: var(--text-xs); }
.text-md   { font-size: var(--text-md); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.font-bold { font-weight: 700; }
.font-semi { font-weight: 600; }
.text-gray { color: var(--gray-500); }
.text-purple { color: var(--purple-start); }
.text-center { text-align: center; }

.p-md  { padding: var(--space-md); }
.px-md { padding-left: var(--space-md); padding-right: var(--space-md); }
.py-sm { padding-top: var(--space-sm);  padding-bottom: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mb-md { margin-bottom: var(--space-md); }
.mb-sm { margin-bottom: var(--space-sm); }

.rounded-full { border-radius: var(--radius-full); }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* Gradient text */
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── LKR CURRENCY ─────────────────────────────────────────── */
.price-lkr::before { content: 'LKR '; font-size: 0.75em; font-weight: 600; }

/* ── STICKY BOTTOM CARD ───────────────────────────────────── */
.sticky-bottom-card {
  position: sticky;
  bottom: calc(var(--bottomnav-h) + 20px);
  left: 0;
  right: 0;
  background: var(--glass-bg);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  padding: var(--space-md);
  box-shadow: 0 -8px 32px rgba(106,17,203,0.12);
  z-index: var(--z-sticky);
}

/* ── COURSE CREATE STEP NAV ─────────────────────────────────── */
.cc-step-nav {
  position: fixed;
  bottom: calc(var(--bottomnav-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  background: var(--glass-bg);
  backdrop-filter: var(--blur);
  border-top: 1px solid var(--glass-border);
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  z-index: var(--z-sticky);
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */

/* ─ Mobile (<768px): always full width, no side gaps ─ */
@media (max-width: 767px) {
  #app {
    max-width: 100%;
    width: 100%;
  }
  .top-bar {
    max-width: 100%;
    width: 100%;
  }
  .bottom-nav {
    max-width: calc(100% - 32px);
    width: calc(100% - 32px);
  }
}

/* ─ 480px (large phones — grid tweak only) ─ */
@media (min-width: 480px) {
  .categories-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ─ 768px–1199px (Tablet) ─ */
@media (min-width: 768px) and (max-width: 1199px) {
  :root {
    --max-w: 800px;
    --text-base: 16px;
  }
  /* App always full width — no side gaps */
  #app {
    max-width: 100%;
    width: 100%;
  }
  /* Top bar full width */
  .top-bar {
    max-width: 100%;
    left: 0;
    transform: none;
    border-radius: 0;
  }
  /* Page content centered within full-width app */
  #page-content {
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
  }
  /* Bottom nav — reasonable pill width */
  .bottom-nav {
    max-width: 520px;
  }
  /* Featured reel — same 16/9 ratio, capped width on tablet */
  .feature-reel {
    max-width: 480px;
    margin: 0 auto;
  }
  /* Grids */
  .categories-grid { grid-template-columns: repeat(5, 1fr); }
  .course-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

/* ─ 1200px (Desktop) — Sidebar Layout ─ */
@media (min-width: 1200px) {
  :root { --max-w: 920px; }

  body { background: #EEEAF6; }

  #app {
    max-width: 100%;
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    min-height: 100vh;
    min-height: 100dvh;
    background: transparent;
  }

  /* ════════════════════════════════════════
     SIDEBAR — Clean white design
  ════════════════════════════════════════ */
  #sidebar-nav {
    display: flex !important;
    width: 252px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100dvh;
    flex-direction: column;
    background: #ffffff;
    border-right: 1px solid rgba(106,17,203,0.08);
    overflow-y: auto;
    z-index: var(--z-nav);
    box-shadow: 2px 0 20px rgba(72,1,146,0.07);
    scrollbar-width: none;
  }
  #sidebar-nav::-webkit-scrollbar { display: none; }
  #sidebar-nav::before, #sidebar-nav::after { display: none; }

  /* sidebar-brand, sidebar-logo, sidebar-name → defined inside .sidebar-bottom section below */

  /* ════════════════════════════════════════
     USER CARD — White glass 3D ID Card
  ════════════════════════════════════════ */
  .sidebar-user-card {
    margin: 12px 10px 10px;
    padding: 0;
    background: linear-gradient(#ffffff, #ffffff) padding-box,
                linear-gradient(135deg, rgba(106,17,203,0.28), rgba(192,132,252,0.22)) border-box;
    border: 2px solid transparent;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    box-shadow:
      0 5px 0 rgba(106,17,203,0.16),
      0 10px 28px rgba(72,1,146,0.12),
      inset 0 1px 0 rgba(255,255,255,1);
    transition: transform 0.22s cubic-bezier(.34,1.26,.64,1), box-shadow 0.22s;
  }
  .sidebar-user-card:hover {
    transform: translateY(-3px);
    box-shadow:
      0 6px 0 rgba(106,17,203,0.18),
      0 14px 30px rgba(72,1,146,0.14),
      inset 0 1px 0 rgba(255,255,255,0.9);
  }
  .sidebar-user-card::before { display: none; }
  .sidebar-user-card::after  { display: none; }

  .suc-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 2.5px rgba(106,17,203,0.28), 0 4px 16px rgba(72,1,146,0.18);
  }
  .suc-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .suc-initials {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #480192, #7c3aed);
    color: white;
    font-weight: 800;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
  }

  /* ════════════════════════════════════════
     GUEST CARD (not logged in)
  ════════════════════════════════════════ */
  .sidebar-guest-card {
    margin: 14px 12px 6px;
    padding: 18px 15px;
    background: linear-gradient(135deg, rgba(124,58,237,0.07) 0%, rgba(146,94,248,0.04) 100%);
    border: 1px solid rgba(139,92,246,0.18);
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(72,1,146,0.07);
  }
  .sgc-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 11px;
    box-shadow: 0 4px 14px rgba(124,58,237,0.35);
  }
  .sgc-icon svg { width: 22px; height: 22px; stroke: white; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .sgc-title {
    color: #1a1a2e;
    font-weight: 800;
    font-size: 14px;
    margin-bottom: 3px;
    letter-spacing: -0.2px;
  }
  .sgc-sub {
    color: #6b7280;
    font-size: 11.5px;
    font-weight: 500;
    margin-bottom: 13px;
    line-height: 1.4;
  }
  .sgc-btns { display: flex; gap: 7px; }
  .sgc-btn-signin {
    flex: 1;
    padding: 8px 0;
    border-radius: 10px;
    border: 1.5px solid rgba(106,17,203,0.25);
    background: rgba(106,17,203,0.06);
    color: #480192;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s;
    text-align: center;
  }
  .sgc-btn-signin:hover { background: rgba(106,17,203,0.12); border-color: rgba(106,17,203,0.40); }
  .sgc-btn-signup {
    flex: 1;
    padding: 8px 0;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s;
    text-align: center;
    box-shadow: 0 3px 12px rgba(124,58,237,0.35);
  }
  .sgc-btn-signup:hover { opacity: 0.88; transform: translateY(-1px); }

  /* ════════════════════════════════════════
     NAV ITEMS — card box
  ════════════════════════════════════════ */
  .sidebar-items {
    flex: 1;
    margin: 0 10px 10px;
    padding: 8px;
    background: linear-gradient(#ffffff, #ffffff) padding-box,
                linear-gradient(135deg, rgba(106,17,203,0.28), rgba(192,132,252,0.22)) border-box;
    border: 2px solid transparent;
    border-radius: 20px;
    box-shadow: 0 4px 0 rgba(72,1,146,0.14), 0 8px 22px rgba(72,1,146,0.07);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 3px;
    scrollbar-width: none;
  }
  .sidebar-items::-webkit-scrollbar { display: none; }

  .sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #4a5270;
    transition: background 0.18s, color 0.18s;
    border: 1px solid transparent;
    background: transparent;
    width: 100%;
    text-align: left;
    user-select: none;
    position: relative;
  }

  /* Colored gradient icon pill */
  .sidebar-item svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    padding: 7px;
    border-radius: 11px;
    box-sizing: content-box;
    stroke: white;
    transition: box-shadow 0.18s;
  }

  .sidebar-item:hover {
    background: rgba(72,1,146,0.05);
    color: #480192;
  }

  /* ─── Home — Purple ─── */
  #snav-home svg                { background: linear-gradient(135deg,#9333ea,#c026d3); box-shadow: 0 2px 10px rgba(147,51,234,0.38); }
  #snav-home.active             { background: rgba(147,51,234,0.09); border-color: rgba(192,132,252,0.28); color: #7c3aed; }

  /* ─── Browse — Amber ─── */
  #snav-browse svg              { background: linear-gradient(135deg,#d97706,#f59e0b); box-shadow: 0 2px 10px rgba(217,119,6,0.38); }
  #snav-browse.active           { background: rgba(217,119,6,0.09); border-color: rgba(251,191,36,0.28); color: #92400e; }

  /* ─── Dashboard — Blue ─── */
  #snav-courses svg             { background: linear-gradient(135deg,#1d4ed8,#3b82f6); box-shadow: 0 2px 10px rgba(37,99,235,0.38); }
  #snav-courses.active          { background: rgba(37,99,235,0.09); border-color: rgba(96,165,250,0.28); color: #1d4ed8; }

  /* ─── Create — Green ─── */
  #snav-create svg              { background: linear-gradient(135deg,#047857,#10b981); box-shadow: 0 2px 10px rgba(5,150,105,0.38); }
  #snav-create.active           { background: rgba(5,150,105,0.09); border-color: rgba(52,211,153,0.28); color: #047857; }

  /* ─── Profile — Pink ─── */
  #snav-profile svg             { background: linear-gradient(135deg,#be185d,#ec4899); box-shadow: 0 2px 10px rgba(219,39,119,0.38); }
  #snav-profile.active          { background: rgba(219,39,119,0.09); border-color: rgba(244,114,182,0.28); color: #be185d; }

  /* ─── More — Slate ─── */
  #snav-menu svg                { background: linear-gradient(135deg,#0f172a,#334155); box-shadow: 0 2px 10px rgba(0,0,0,0.32); }
  #snav-menu.active             { background: rgba(51,65,85,0.09); border-color: rgba(148,163,184,0.28); color: #334155; }

  /* ── Create item override ── */
  .sidebar-item--create         { background: transparent !important; color: #4a5270 !important; }
  .sidebar-item--create:hover   { background: rgba(72,1,146,0.05) !important; color: #480192 !important; }
  .sidebar-item--create.active  { background: rgba(5,150,105,0.09) !important; border-color: rgba(52,211,153,0.28) !important; color: #047857 !important; }

  /* ════════════════════════════════════════
     SIDEBAR BOTTOM — unified 2D card box
  ════════════════════════════════════════ */
  .sidebar-bottom {
    margin: 0 10px 14px;
    background: linear-gradient(#ffffff, #ffffff) padding-box,
                linear-gradient(135deg, rgba(106,17,203,0.28), rgba(192,132,252,0.22)) border-box;
    border: 2px solid transparent;
    border-radius: 20px;
    box-shadow: 0 4px 0 rgba(72,1,146,0.14), 0 8px 22px rgba(72,1,146,0.07);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  /* Brand row — top of the card */
  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 15px 12px;
    border-bottom: 1px solid rgba(72,1,146,0.12);
    cursor: pointer;
    transition: background 0.15s;
    border-top: none;
  }
  .sidebar-brand:hover { background: rgba(72,1,146,0.03); }

  .sidebar-logo {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(72,1,146,0.18);
  }
  .sidebar-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 16px;
    color: #7c3aed;
    background: none;
    -webkit-text-fill-color: #7c3aed;
    letter-spacing: -0.3px;
  }

  /* Coin row */
  .sidebar-coin-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 15px;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(72,1,146,0.12);
    background: linear-gradient(135deg, rgba(251,191,36,0.07) 0%, rgba(245,158,11,0.04) 100%);
    cursor: pointer;
    text-align: left;
    transition: background 0.18s;
    box-sizing: border-box;
  }
  .sidebar-coin-btn:hover { background: linear-gradient(135deg, rgba(251,191,36,0.13) 0%, rgba(245,158,11,0.09) 100%); }
  .sidebar-coin-balance {
    font-size: 16px;
    font-weight: 900;
    color: #92400e;
    line-height: 1;
    font-family: var(--font-display);
  }
  .sidebar-coin-label {
    font-size: 10px;
    color: #b45309;
    font-weight: 600;
    margin-top: 2px;
    white-space: nowrap;
  }

  /* Promote / Download rows */
  .sidebar-bottom-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(72,1,146,0.10);
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #4a5270;
    transition: background 0.15s, color 0.15s;
    box-sizing: border-box;
  }
  .sidebar-bottom-row:last-child { border-bottom: none; }
  .sidebar-bottom-row:hover { background: rgba(72,1,146,0.04); color: #480192; }
  .sidebar-bottom-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  /* ── Main Area ── */
  #main-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--white);
    min-height: 100dvh;
  }

  /* ── Top Bar (desktop — sticky in flow) ── */
  .top-bar {
    position: sticky;
    top: 0;
    width: 100%;
    max-width: none;
    left: 0;
    transform: none;
    border-radius: 0;
    z-index: var(--z-sticky);
  }

  /* ── Notif Panel (desktop) ── */
  .notif-panel {
    position: fixed;
    top: calc(var(--topbar-h) + 8px);
    right: 24px;
    left: auto;
    width: 360px;
    max-width: 360px;
    transform: translateY(-8px);
    border-radius: var(--radius-2xl);
  }
  .notif-panel.show { transform: translateY(0); }

  /* ── Page Content (desktop) — FULL WIDTH, no centering ── */
  #page-content {
    flex: 1;
    padding-top: 0;
    padding-bottom: 48px;
    max-width: none;
    margin: 0;
    width: 100%;
  }

  /* ── Hide bottom nav ── */
  .bottom-nav { display: none !important; }

  /* ════════════════════════════════════════
     DESKTOP RIGHT PANEL
  ════════════════════════════════════════ */
  #desktop-right-panel {
    width: 350px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow-y: auto;
    background: #ffffff;
    border-left: 1px solid rgba(106,17,203,0.08);
    box-shadow: -2px 0 20px rgba(72,1,146,0.07);
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
  }
  #desktop-right-panel::-webkit-scrollbar { display: none; }
  #desktop-right-panel::before, #desktop-right-panel::after { display: none; }

  /* ── Course create step nav — inline on desktop ── */
  .cc-step-nav {
    position: static;
    transform: none;
    left: auto;
    bottom: auto;
    max-width: none;
    width: 100%;
    background: transparent;
    backdrop-filter: none;
    border-top: none;
    padding: 24px 0 0;
  }

  /* ── Grid adjustments — use full width ── */
  .categories-grid { grid-template-columns: repeat(7, 1fr); }
  .course-grid { grid-template-columns: repeat(4, 1fr) !important; }

  /* ── Featured reel — free to expand ── */
  .feature-reel {
    max-width: none;
    margin: 0;
  }

  /* ── Home page — wider hero padding on desktop ── */
  .home-page > div:first-child {
    padding: 36px 40px 52px !important;
  }
  .home-page > div:first-child h2 {
    font-size: 30px !important;
  }

  /* ── Home feature wrap — more breathing room ── */
  #home-feature-wrap {
    padding: 20px 24px 0 !important;
    gap: 0 !important;
  }
  /* Feature: equal half — 50/50 split at desktop */
  #home-feature-wrap #feature-section {
    flex: 1 !important;
  }
  /* Cards: equal half — 50/50 split */
  #guru-tests-promo {
    flex: 1 !important;
    width: auto !important;
    padding-left: 20px !important;
  }

  /* ── Floating tab card — full width with padding ── */
  .home-page > div:nth-child(2) {
    padding: 0 24px !important;
    margin-top: -24px !important;
  }

  /* ── Course grids — 4 columns, wider padding ── */
  .courses-grid {
    grid-template-columns: repeat(4, 1fr);
    padding: 0 24px;
  }
  .categories-grid { padding: 0 24px; }

  /* ── Home section headers — wider padding ── */
  #courses-header,
  #continue-learning-section > div:first-child,
  #upcoming-live-section { padding-left: 24px !important; padding-right: 24px !important; }

  #institutes-grid { padding-left: 24px !important; padding-right: 24px !important; }

  /* ── Admin tabs wrap nicely ── */
  .admin-tabs { flex-wrap: nowrap; overflow-x: auto; }
}

/* ══════════════════════════════════════════════════════════════
   ADMIN DARK MODE — applied via body.admin-dark on desktop only
   Overrides sidebar-nav and desktop-right-panel to match
   the Admin Panel's dark navy colour scheme.
══════════════════════════════════════════════════════════════ */
@media (min-width: 1200px) {

  /* ── Main content — remove white gap at bottom ── */
  body.admin-dark #main-area  { background: #07051A; }
  body.admin-dark #page-content { background: #07051A; }

  /* ── Sidebar shell ── */
  body.admin-dark #sidebar-nav {
    background: #07051A;
    border-right-color: rgba(167,139,250,0.14);
    box-shadow: 2px 0 28px rgba(0,0,0,0.45);
  }

  /* ════ ID CARD — dark glass ════ */
  body.admin-dark .sidebar-user-card {
    background: rgba(12, 4, 36, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.34);
    box-shadow:
      inset 0 1px 0 rgba(167,139,250,0.22),
      inset 0 -1px 0 rgba(0,0,0,0.18),
      0 14px 42px rgba(0,0,0,0.58),
      0 3px 12px rgba(124,58,237,0.26);
  }
  body.admin-dark .sidebar-user-card:hover {
    transform: translateY(-2px);
    box-shadow:
      inset 0 1px 0 rgba(167,139,250,0.28),
      0 20px 50px rgba(0,0,0,0.64),
      0 4px 14px rgba(124,58,237,0.30);
  }
  /* All inline text in card → light purple-white */
  body.admin-dark .sidebar-user-card div,
  body.admin-dark .sidebar-user-card span {
    color: rgba(221, 214, 254, 0.78) !important;
  }
  /* Name → near-white emphasis */
  body.admin-dark .sidebar-user-card div[style*="color:#1a1a2e"] {
    color: #F0EEFF !important;
    text-shadow: 0 1px 10px rgba(124,58,237,0.35);
  }
  /* Institute badge → light green */
  body.admin-dark .sidebar-user-card div[style*="color:#059669"],
  body.admin-dark .sidebar-user-card span[style*="color:#059669"] {
    color: #6EE7B7 !important;
  }
  body.admin-dark .sidebar-user-card svg[stroke="#059669"] { stroke: #6EE7B7 !important; }
  /* Role badge */
  body.admin-dark .sidebar-user-card span[style*="color:#7c3aed"] {
    color: #C4B5FD !important;
    background: rgba(124,58,237,0.24) !important;
    border-color: rgba(167,139,250,0.32) !important;
  }
  /* Serial ID chip */
  body.admin-dark .sidebar-user-card div[style*="background:rgba(72,1,146,0.06)"] {
    background: rgba(124,58,237,0.16) !important;
    border-color: rgba(167,139,250,0.24) !important;
  }
  /* Inner divider line */
  body.admin-dark .sidebar-user-card div[style*="height:1px"] {
    background: rgba(139,92,246,0.20) !important;
  }
  /* Avatar ring */
  body.admin-dark .suc-avatar {
    border-color: rgba(167,139,250,0.42);
    box-shadow: 0 0 0 2.5px rgba(124,58,237,0.48), 0 4px 16px rgba(0,0,0,0.42);
  }

  /* ════ NAV ITEMS ════ */
  body.admin-dark .sidebar-items {
    background: rgba(124,58,237,0.07);
    border: 1px solid rgba(167,139,250,0.13);
    border-radius: 18px;
    box-shadow: none;
  }
  body.admin-dark .sidebar-item { color: rgba(196,181,253,0.55); }
  /* Icon shape strokes → WHITE (keep coloured pill backgrounds) */
  body.admin-dark .sidebar-item svg { stroke: #ffffff !important; filter: none; }
  body.admin-dark .sidebar-item:hover {
    background: rgba(124,58,237,0.18);
    color: #EDE9FE;
    border-color: rgba(167,139,250,0.25);
  }
  body.admin-dark .sidebar-item:hover svg { stroke: #ffffff !important; }

  /* Active row */
  body.admin-dark .sidebar-item.active,
  body.admin-dark #snav-home.active,
  body.admin-dark #snav-browse.active,
  body.admin-dark #snav-courses.active,
  body.admin-dark #snav-create.active,
  body.admin-dark #snav-profile.active,
  body.admin-dark #snav-menu.active {
    background: rgba(124,58,237,0.26) !important;
    border-color: rgba(167,139,250,0.36) !important;
    color: #DDD6FE !important;
  }
  body.admin-dark .sidebar-item.active svg,
  body.admin-dark #snav-home.active svg,
  body.admin-dark #snav-browse.active svg,
  body.admin-dark #snav-courses.active svg,
  body.admin-dark #snav-create.active svg,
  body.admin-dark #snav-profile.active svg,
  body.admin-dark #snav-menu.active svg { stroke: #ffffff !important; filter: none !important; }

  /* ════ BOTTOM CARD — dark glass (matches ID card) ════ */
  body.admin-dark .sidebar-bottom {
    background: rgba(12, 4, 36, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.30);
    box-shadow:
      inset 0 1px 0 rgba(167,139,250,0.18),
      0 10px 36px rgba(0,0,0,0.52);
  }
  body.admin-dark .sidebar-brand { border-bottom-color: rgba(139,92,246,0.16); }
  body.admin-dark .sidebar-brand:hover { background: rgba(124,58,237,0.10); }
  body.admin-dark .sidebar-name { color: #DDD6FE; -webkit-text-fill-color: #DDD6FE; }
  /* Coin row */
  body.admin-dark .sidebar-coin-btn { background: rgba(124,58,237,0.10); border-color: rgba(167,139,250,0.16); }
  body.admin-dark .sidebar-coin-btn:hover { background: rgba(124,58,237,0.18); }
  body.admin-dark .sidebar-coin-balance { color: #FDE68A; }
  body.admin-dark .sidebar-coin-label   { color: rgba(253,230,138,0.60); }
  body.admin-dark .sidebar-coin-btn > svg { stroke: rgba(253,230,138,0.45) !important; }
  /* Promote / Download rows */
  body.admin-dark .sidebar-bottom-row {
    color: rgba(221,214,254,0.65);
    border-top-color: rgba(139,92,246,0.13);
  }
  body.admin-dark .sidebar-bottom-row span { color: inherit !important; }
  body.admin-dark .sidebar-bottom-row:hover { background: rgba(124,58,237,0.16); color: #EDE9FE; }
  body.admin-dark .sidebar-bottom-icon {
    background: rgba(124,58,237,0.18) !important;
    border-color: rgba(167,139,250,0.20) !important;
  }
  body.admin-dark .sidebar-bottom-icon svg { stroke: #C4B5FD !important; }
  /* Chevron arrow on right of each row */
  body.admin-dark .sidebar-bottom-row > svg:last-child { stroke: rgba(167,139,250,0.38) !important; }

  /* ── Right panel ── */
  body.admin-dark #desktop-right-panel {
    background: #07051A;
    border-left-color: rgba(167,139,250,0.14);
    box-shadow: -2px 0 28px rgba(0,0,0,0.45);
  }
}
