:root {
  --bg: #081726;
  --bg2: #050f18;
  --card: #041018;

  --text: #eaf2ff;
  --muted: #64748b;
  --mutedd: #9eb3d1;
  --accent: #38bdf8;
  --accent2: rgba(56, 189, 248, 0.15);

  --success: #22c55e;
  --danger: #ff4b5c;

  --border: rgba(234, 242, 255, 0.12);
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);

  --r: 18px;
  --r2: 22px;
  --pad: 18px;

  --max: 1180px;
  --font: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

/* ==============================
   LIGHT THEME
============================== */

[data-theme="light"] {
  --bg: #f3f6fb;
  --bg2: #ffffff;
  --card: #ffffff;

  --text: #0f172a;
  --muted: #475569;
  --mutedd: #475569;

  --accent: #2563eb;
  --accent2: rgba(37, 99, 235, 0.12);

  --success: #16a34a;
  --danger: #dc2626;

  --border: #e2e8f0;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  
}

[data-theme="light"] .kbd {
  color: #334155;              /* slate-700 */
  background: #f1f5f9;         /* soft slate */
  border: 1px solid #2563eb;   /* subtle border */
}

[data-theme="light"] body {
  background: var(--bg);
}

[data-theme="light"] .card {
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}

[data-theme="light"] .nav-links a:hover {
  background: rgba(37, 99, 235, 0.08);
}

[data-theme="light"] .btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .btn:hover {
  background: #e2e8f0;
}
[data-theme="light"] .btn.primary {
  background: #2563eb;
  color: white;
}

[data-theme="light"] .card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .nav {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}
[data-theme="light"] #breadcrumb,
[data-theme="light"] .breadcrumb-pill {
  background: #e8f0ff;
  border: 1px solid #2563eb;
  color: #1e40af;
}

[data-theme="light"] .breadcrumb-pill a {
  color: #1e40af;
}

[data-theme="light"] .course-duration {
  background: #eef4ff;
  border: 1px solid #2563eb;
  color: #1e3a8a;
  box-shadow: none;
}

[data-theme="light"] .badge {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}


[data-theme="light"] .badge.ok {
  background: #dcfce7;
  border: 1px solid #16a34a;
  color: #065f46;
}

[data-theme="light"] .badge,
[data-theme="light"] .resource-badge,
[data-theme="light"] .resource-pill {
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  color: #334155;
}

[data-theme="light"] .btn.small {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
}


[data-theme="light"] .grid-2 > .card {
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}


[data-theme="light"] .progress {
  background: #cbd5e1;
  border: 1px solid #cbd5e1;
}

[data-theme="light"] .progress > div {
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

[data-theme="light"] .progress.sm {
  background: #cbd5e1;
  border: none;
}

[data-theme="light"] .input {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .input::placeholder {
  color: #94a3b8;
}

[data-theme="light"] .input:focus {
  border-color: #2563eb;
}


[data-theme="light"] .h1 {
  color: #0f172a;
}

[data-theme="light"] .h2 {
  color: #0f172a;
}


[data-theme="light"] .lesson-header {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-weight: 600;
}

[data-theme="light"] .item {
  background: transparent;
  color: #334155;
  border: 1px solid transparent;
}

[data-theme="light"] .item:hover {
  background: #f1f5f9;
}


[data-theme="light"] .item.active {
  background: #e8f0ff;
  border: 1px solid #2563eb;
  color: #0f172a;
}

[data-theme="light"] .item.active .topic-title {
  color: #0f172a;
  font-weight: 600;
}

[data-theme="light"] .topic-duration {
  background: #f1f5f9;
  border: 1px solid #2563eb;
  color: #334155;
  box-shadow: none;
}

[data-theme="light"] .topic-duration.completed {
  background: #dcfce7;
  border: 1px solid #16a34a;
  color: #065f46;
}

[data-theme="light"] .lesson-topics {
  padding-left: 8px;
}

[data-theme="light"] .resource-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  transition: 0.2s ease;
}

[data-theme="light"] .resource-item:hover {
  background: #eef4ff;
  border-color: #2563eb;
}

[data-theme="light"] .resource-item strong {
  color: #0f172a;
}

[data-theme="light"] .resource-item .muted {
  color: #64748b;
}


[data-theme="light"] .resource-item .badge {
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  color: #334155;
}

[data-theme="light"] .btn.small {
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  color: #334155;
}


[data-theme="light"] .hr {
  background: #e2e8f0;
}

[data-theme="light"] details summary {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: 600;
  color: #0f172a;
}

[data-theme="light"] .accordion .item {
  background: transparent;
  border: 1px solid transparent;
  color: #334155;
}

[data-theme="light"] .accordion .item:hover {
  background: #f1f5f9;
}

[data-theme="light"] .resource-row {
  display: flex;
  justify-content: space-between;
  align-items: center;

  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;

  padding: 14px;
  margin-bottom: 12px;

  transition: 0.2s ease;
}

[data-theme="light"] .resource-row:hover {
  background: #eef4ff;
  border-color: #2563eb;
}

[data-theme="light"] .resource-row a {
  color: #0f172a;
  font-weight: 500;
}

[data-theme="light"] .resource-row .kbd {
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  color: #334155;
}

#resumeBtn {
  margin-left: auto;
}

.resource-row {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 14px;
  margin-bottom: 12px;

  border-radius: 14px;
  border: 1px solid var(--border);

  background: rgba(255, 255, 255, 0.04);
  transition: 0.2s ease;
}

.resource-row:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
}

.resource-row a {
  font-weight: 500;
}

.resource-row .kbd {
  background: rgba(255, 255, 255, 0.06);
}



* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 16px 60px;
}


.brand .dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.12);
}
.nav-links {
  display: flex;
  gap: 14px;
  align-items: center;
}


.nav-links a.active::after {
  content: "";
  display: block;
  height: 3px;
  margin: 6px auto 0 auto; /* center under text */
  width: 60%;
  background: var(--accent);
  border-radius: 3px;
}

.nav-links a.active,
.nav-links a:hover {
  background: rgba(234, 242, 255, 0.06);
  color: var(--text);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(234, 242, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.h1 {
  font-size: 34px;
  line-height: 1.05;
  margin: 18px 0 8px;
  letter-spacing: -0.4px;
}
.h2 {
  font-size: 20px;
  margin: 0 0 10px;
}
.p {
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

.grid {
  display: grid;
  gap: 16px;
}
.grid-2 {
  grid-template-columns: 1.6fr 1fr;
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 1100px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  box-shadow: var(--shadow);
  padding: var(--pad);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(234, 242, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}
.btn:hover {
  background: rgba(234, 242, 255, 0.1);
}
.btn.primary {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.95), rgba(56, 189, 248, 0.7));
  border: 0;
  color: #021018;
}
.btn.primary:hover {
  filter: brightness(1.05);
}
.btn.ghost {
  background: transparent;
}
.btn.small {
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 13px;
}

.input {
  width: 100%;
  background: rgba(234, 242, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  outline: none;
}
.input::placeholder {
  color: rgba(234, 242, 255, 0.45);
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.space {
  height: 14px;
}

.progress {
  height: 10px;
  background: rgba(234, 242, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(234, 242, 255, 0.1);
}
.progress-text {
  margin-top: 8px;
  margin-bottom: 8px;
}
.progress > div {
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, var(--accent), rgba(56, 189, 248, 0.55));
}

.hr {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(56, 189, 248, 0.1);
}
.badge.ok {
  background: rgba(34, 197, 94, 0.1);
}
.badge.danger {
  background: rgba(255, 75, 92, 0.1);
}

.accordion details {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(234, 242, 255, 0.04);
  padding: 10px 12px;
}
.accordion summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}
.accordion summary::-webkit-details-marker {
  display: none;
}

.item:hover {
  background: rgba(234, 242, 255, 0.06);
  color: var(--text);
}
.item .left {
  display: flex;
  gap: 10px;
  align-items: center;
}

.kbd {
  font-size: 12px;
  color: rgba(234, 242, 255, 0.65);
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
}
.accordion summary .kbd {
  white-space: nowrap;
}


/* ---- Mobile responsiveness patch ---- */
@media (max-width: 560px) {
  .container {
    padding: 18px 14px 48px;
  }

  .h1 {
    font-size: 28px;
    line-height: 1.1;
  }
  .h2 {
    font-size: 18px;
  }
  .p {
    font-size: 14px;
  }

  .card {
    padding: 14px;
    border-radius: 18px;
  }
  .grid {
    gap: 14px;
  }

  /* Nav: make it compact + wrap nicely */
  .nav-in {
    padding: 12px 14px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .brand {
    font-size: 14px;
  }

  /* Move links to their own row and allow horizontal scroll */
  .nav-links {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding-bottom: 2px;
  }
  .nav-links a {
    white-space: nowrap;
    padding: 9px 10px;
    border-radius: 999px;
    background: rgba(234, 242, 255, 0.04);
    border: 1px solid rgba(234, 242, 255, 0.1);
  }
  .nav-links a.active {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.25);
  }

  /* Buttons feel better on mobile */
  .btn {
    width: 100%;
    justify-content: center;
  }
  .row {
    gap: 10px;
  }
  .row > .btn {
    flex: 1;
  }

  /* Pills wrap cleanly */
  .pill {
    flex-wrap: wrap;
    gap: 6px;
  }
}
.lesson-title {
  font-weight: 600;
  margin: 14px 0 6px;
  opacity: 0.9;
}
.lesson-topics {
  overflow: hidden;
  transition: max-height .3s ease;
}


.player {
  aspect-ratio: 16/9;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  top: 90px;
  z-index: 5;
  margin-bottom: 10px;
}

.player iframe {
  width: 100%;
  height: 100%;
  border: 0;
  
}

.lesson-block {
  margin-bottom: 10px;
}

.lesson-header {
  display: grid;
  grid-template-columns: 1fr auto; /* title | duration */
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  background: var(--bg2);
  border: 1px solid var(--border);
  font-weight: 600;
}

[data-theme="light"] .lesson-header.active {
  background: #e8f0ff;
  border-color: #2563eb;
  color: #0f172a;
}

.lesson-topics {
  margin-top: 6px;
}


.muted {
  opacity: 0.65;
  font-size: 12px;
}

.topic-duration {
  width: 86px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;

  background: var(--bg2);
  border-radius: 999px;
  border: 1px solid var(--accent);
  box-shadow: 0 0 10px var(--accent2);
  color: var(--text);
}

[data-theme="light"] .topic-duration {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  box-shadow: none;
  color: #0f172a;
}
/* Clock icon inside badge */
.topic-duration::before {
  content: "";
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background: url("/app/assets/clock.svg") no-repeat center;
  background-size: contain;
  filter: brightness(0) saturate(100%) invert(62%) sepia(71%) saturate(416%) hue-rotate(165deg) brightness(95%)
    contrast(92%);
}

.lesson-item {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 10px 0 6px;
  font-weight: 600;
  color: var(--text);
}

/* Topic indentation */

/* Topic row layout */
.item:not(.lesson-item) {
  display: grid;
  grid-template-columns: 1fr auto; /* title | duration */
  align-items: center;
  gap: 12px;

  padding-left: 10px;
}

.lesson-header .topic-duration {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.6),
    0 0 18px rgba(56, 189, 248, 0.6);
}
/* Topic page grid */
/* Desktop layout */
.topic-grid {
  display: grid;
  grid-template-columns: 30% 70%;
  gap: 20px;
}

/* Tablet & Mobile */
@media (max-width: 1024px) {
  .topic-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile: stack sidebar + video */
@media (max-width: 768px) {
  .topic-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .topic-grid > .card:first-child {
    order: 2; /* lesson list */
  }

  .topic-grid > .card:last-child {
    order: 1; /* video */
  }
}

@media (max-width: 560px) {
  #toggleAllBtn {
    width: auto;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 999px;
  }
}

@media (max-width: 560px) {
  .lesson-header {
    padding: 14px 16px;
  }


  .topic-duration {
    width: 78px;
    height: 26px;
    font-size: 11px;
  }
}

/* Remove sticky video on mobile */
@media (max-width: 560px) {
  .player {
    position: static;
  }
}

@media (min-width: 1024px) {
  .topic-grid > .card:last-child {
    position: sticky;
    top: 80px;
  }
}

/* Topic context wrapper */
.topic-context {
  margin-top: 6px;
  margin-bottom: 18px;
}

/* Course pill before topic title */
.topic-course-pill {
  display: inline-block;
  padding: 6px 12px;
  margin-bottom: 6px;

  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;

  color: #bfe9ff;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.18), rgba(56, 189, 248, 0.08));

  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 999px;
}

/* Topic title under course */
.topic-title-main {
  font-size: 22px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 768px) {
  .topic-title-main {
    font-size: 18px;
  }

  .topic-course-pill {
    font-size: 11px;
    padding: 5px 10px;
  }
}



.lesson-header.active {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.35);
}

@keyframes activeGlow {
  from {
    box-shadow: 0 0 0 rgba(56, 189, 248, 0);
  }
  to {
    box-shadow: 0 0 22px rgba(56, 189, 248, 0.45);
  }
}

.item:not(.active)::before {
  display: none;
}

.item.active .topic-title {
  color: var(--text);
  font-weight: 600;
}

/* Arrow OUTSIDE clock pill (current topic only) */
.item.active .topic-duration {
  position: relative;
}

/* Now Playing indicator (before title) */

@media (max-width: 560px) {
  .item.active::before {
    font-size: 10px;
    padding: 3px 6px;
  }
}

/* Topic row base */
.item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 10px;
  position: relative;
  transition: background .25s ease, transform .25s ease, box-shadow .25s ease;
}

.item:hover {
  background: rgba(56,189,248,.08);
  transform: translateX(3px);
  color: var(--text);
}

.item.active {
  background: linear-gradient(90deg, rgba(56,189,248,.20), rgba(56,189,248,.06));
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  position: relative;
  box-shadow: 0 0 0 1px rgba(56,189,248,.18), 0 10px 20px rgba(56,189,248,.10);
  transform: translateX(4px);
  animation: activeGlow 0.6s ease-out;
}

[data-theme="light"] .item.active {
  background: #eef4ff;
  border: 1px solid #2563eb;
  animation: none;
}

#prevBtn, #nextBtn {
  font-family: inherit;
}

#resumeBtn svg, #prevBtn svg, #nextBtn svg {
  flex-shrink: 0;
}

/* Left content (status + title stacked) */
.item a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

/* Now Playing badge */

.item.active a::before {
  content: none;
}

.now-playing-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  white-space: nowrap;
  line-height: 1.35;
}

.item .topic-title {
  line-height: 1.35;
}

@media (max-width: 560px) {
  .item.active a::before {
    font-size: 10px;
    padding: 2px 6px;
  }
}

.page-loader {
  position: fixed;
  inset: 0;
  background: #020b14;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-loader {
  transition: opacity .3s ease;
}

.loader-card {
  width: 90%;
  max-width: 1200px;
  height: 420px;
  border-radius: 18px;
  background: linear-gradient(90deg, #0b1622 25%, #112236 37%, #0b1622 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

/* Scrool Topic */

/* Scrollable topic list */
#topicList {
  max-height: 600px; 
  overflow-y: auto;
  padding-right: 6px;
}

@media (max-width: 768px) {
  #topicList {
    max-height: 400px;
  }
}


/* Smooth modern scrollbar */
#topicList::-webkit-scrollbar {
  width: 6px;
}
#topicList::-webkit-scrollbar-track {
  background: transparent;
}
#topicList::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.25);
  border-radius: 999px;
}
#topicList::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.45);
}

/* Course total duration (Course Info card) */
.course-duration {
  margin-top: 8px;

  display: inline-flex;
  align-items: center;
  gap: 8px;

  font-size: 14px;
  font-weight: 600;

  color: #bfe9ff;

  padding: 8px 12px;
  border-radius: 12px;

  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

/* SVG clock icon */
.course-duration::before {
  content: "";
  width: 14px;
  height: 14px;
  flex-shrink: 0;

  background: url("/app/assets/clock.svg") no-repeat center;
  background-size: contain;

  filter: brightness(0) saturate(100%) invert(62%) sepia(71%) saturate(416%) hue-rotate(165deg) brightness(95%)
    contrast(92%);
}

/* Play indicator on hover (inactive topics only) */

/* Left content layout */

/* Play icon before topic title */
.play-icon {
  width: 22px;
  height: 22px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  transform: scale(0.85);
  transition: all 0.2s ease;

  flex-shrink: 0;
}

.play-icon::before {
  content: "";
  width: 10px;
  height: 10px;

  background: url("/app/assets/play.svg") no-repeat center;
  background-size: contain;

  filter: brightness(0) saturate(100%) invert(62%) sepia(71%) saturate(416%) hue-rotate(165deg) brightness(95%)
    contrast(92%);
}

/* Active topic play icon */
.item:hover .play-icon {
  opacity: 1;
  transform: scale(1);
}
.item.active .play-icon {
  opacity: 1;
  transform: scale(1);
}
/* Remove default markers from details/summary completely */
details summary {
  list-style: none;
}

details summary::marker,
details summary::-webkit-details-marker {
  display: none;
}

/* Kill any leftover pseudo bullets inside topics */
.item::before,
.item .left::before {
  content: none !important;
  display: none !important;
}

/* Remove any list / marker / bullet visuals from topic rows */
.item,
.item::before {
  list-style: none !important;
  content: none !important;
}

.item .left::before {
  content: none !important;
}

/* Breadcrumb styling (shared with topic.html) */
#breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  font-size: 13px;
  font-weight: 600;
  color: #bfe9ff;

  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 999px;
  padding: 6px 12px;
}

.crumb-sep {
  opacity: 0.6;
}

/* Dashboard css */
.course-card {
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.course-img {
  width: 100%;
  height: 250px;
  object-fit: cover;

  /* rounded top corners only */
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
}

.course-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 3px; /* Reduced from 12px for tighter spacing */
}

.course-body > .h3 {
  flex-shrink: 0; /* Don't shrink the title */
}

.course-body > .progress,
.course-body > .row,
.course-body > p {
  flex-shrink: 0; /* Don't shrink content */
}

.course-body > .space {
  flex-grow: 1; /* This will push the button down */
  min-height: 8px; /* Minimum spacing */
}

.course-body > a.btn {
  margin-top: auto; /* Push button to bottom */
  flex-shrink: 0; /* Don't shrink the button */
}

.progress.sm {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  margin: 10px 0;
}

.progress.sm > div {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #22d3ee);
}

.w-full {
  width: 100%;
}

#coursesList .card {
  padding: 0;
}

.course-body .h3 {
  margin-bottom: 6px; /* Reduced from 10px */
  min-height: 3em; /* Reserve space for 2 lines of text */
  display: flex;
  align-items: flex-start;
}


.breadcrumb-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.15);
  font-size: 13px;
  margin-bottom: 14px;
}

.breadcrumb-pill a {
  color: #9fdcff;
  text-decoration: none;
}

.topic-header {
  margin-bottom: 28px;
}


/* Completed pill */
.topic-duration.completed {
  border-color: rgba(34, 197, 94, 0.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.6),
    0 0 18px rgba(34, 197, 94, 0.55);
}

[data-theme="light"] .topic-duration.completed {
  border-color: #16a34a;
}


/* Check mark styling */
.completed-check {
  color: #22c55e;
  font-weight: 700;
  margin-right: 4px;
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
}



/* ==========================
   GLOBAL GRID FIX (MOBILE)
========================== */

@media (max-width: 1024px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   COURSE PAGE – FULL MOBILE OPTIMIZATION
========================================= */

@media (max-width: 768px) {

  /* Container tighter on mobile */
  .container {
    padding: 16px 14px 40px;
  }

  /* Force 1 column everywhere */
  .grid-2 {
    grid-template-columns: 1fr !important;
  }

  /* Course header stack */
  .course-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .course-header > .row {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .course-header .btn {
    width: 100%;
  }

  /* Make cards breathe better */
  .card {
    padding: 16px;
  }

  /* Reduce large heading size */
  .h1 {
    font-size: 24px;
    line-height: 1.2;
  }

}



/* =====================================
   CLEAN MOBILE NAVBAR
===================================== */

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Profile name inside dropdown */
.profile-name {
  padding: 12px 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

/* MOBILE FIX */
@media (max-width: 768px) {

  .nav-in {
    flex-wrap: nowrap;
  }

  .nav-left {
    flex: 1;
  }

  .nav-right {
    flex: 0;
  }

  .profile-chip {
    padding: 6px 10px;
  }
}



/* ======================================
   COURSE HEADER RESPONSIVE FIX
====================================== */

.course-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

/* Right button wrapper */
.course-header > .row {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* MOBILE */
@media (max-width: 768px) {

  .course-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .course-header > .row {
    width: 100%;
    flex-direction: column;
  }

  .course-header .btn {
    width: 100%;
  }
}

/* NAVBAR */

.profile-dropdown {
  position: relative;
}


.profile-menu button:hover {
  background:#222;
}

.profile-menu.show {
  display:block;
}

/* MODAL */
.profile-modal {
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.6);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:2000;
}



/* Profile Crete */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-box {
  background: #111827;
  padding: 30px;
  border-radius: 16px;
  width: 320px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.modal-box h2 {
  margin-bottom: 20px;
  font-size: 18px;
}

.modal-box input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: none;
  margin-bottom: 20px;
  background: #1f2937;
  color: #fff;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.hidden {
  display: none;
}

/* ===== PROFILE NETFLIX PANEL ===== */

/* ===== PROFILE NETFLIX PANEL IMPROVED ===== */

.profile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: .25s ease;
  z-index: 999;
}

.profile-overlay.show {
  opacity: 1;
  visibility: visible;
}

.profile-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  max-width: 100%;
  height: 100vh;

  background: var(--bg);
  border-left: 1px solid var(--border);

  transform: translateX(100%);
  transition: .35s cubic-bezier(.4,0,.2,1);
  z-index: 1000;

  display: flex;
  flex-direction: column;

  padding: 24px 20px;
}

.profile-panel.open {
  transform: translateX(0);
}

/* Header */
.profile-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.profile-panel-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .3px;
}

.profile-panel-header button {
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  opacity: .7;
}

.profile-panel-header button:hover {
  opacity: 1;
}

/* Scrollable Profile List */
.profile-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  overflow-y: auto;
}

/* Mobile: Maximize profile list height while keeping footer visible */
@media (max-width: 768px) {
  .profile-list {
    max-height: calc(80vh - 130px);
  }
}

/* Modern Scrollbar */
.profile-list::-webkit-scrollbar {
  width: 6px;
}
.profile-list::-webkit-scrollbar-track {
  background: transparent;
}
.profile-list::-webkit-scrollbar-thumb {
  background: rgba(56,189,248,.35);
  border-radius: 999px;
}
.profile-list::-webkit-scrollbar-thumb:hover {
  background: rgba(56,189,248,.55);
}

/* Profile Card */
.panel-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 14px;
  transition: .2s ease;
}

.panel-profile-card:hover {
  background: rgba(56,189,248,.12);
  transform: translateX(-4px);
}

/* Avatar */
.panel-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
}

[data-theme="light"] .panel-avatar {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
}

/* Name */
.panel-name {
  font-weight: 500;
  font-size: 15px;
}

/* Footer */
.profile-panel-footer {
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid var(--border);

  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.panel-link:hover {
  color: var(--text);
}

.panel-link.logout {
  color: #ff4b5c;
}
.panel-profile-card.active-profile {
  border: 1px solid rgba(56,189,248,.5);
  background: rgba(56,189,248,.08);
}

/* ==============================
   NAVBAR PREMIUM
============================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(18px);
  background: rgba(5, 15, 24, 0.75);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: 0.3s ease;
}

[data-theme="light"] .nav {
  background: rgba(255,255,255,0.85);
  border-bottom: 1px solid #e2e8f0;
}


.nav-links a:hover {
  transform: translateY(-1px);
}


.nav-links a.active {
  opacity: 1;
  font-weight: 600;
}

/* ===============================
   PROFILE CHIP
=============================== */

.profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  transition: all .2s ease;
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}

.profile-chip:hover {
  background: rgba(56,189,248,.18);
  border-color: rgba(56,189,248,.5);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

[data-theme="light"] .profile-chip {
  background: white;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
}

.profile-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

[data-theme="light"] .profile-avatar {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
}

.profile-name-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .2px;
  display: none;
}

.profile-caret {
  font-size: 12px;
  opacity: .7;
  margin-left: 4px;
}

.nav-in {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  color: var(--mutedd);
  text-decoration: none;
  font-weight: 500;
  padding: 6px 0;
  position: relative;
  transition: .2s ease;
  display: inline-block; /* important */
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a.active {
  color: var(--text);
}


.profile-trigger {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
  transition: .2s ease;
}

.profile-trigger:hover {
  background: rgba(56,189,248,.12);
}

/* ==============================
   MOBILE
============================== */

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text);
  cursor: pointer;
}

@media (max-width: 768px) {

  .mobile-menu-btn {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #081726;
    flex-direction: column;
    gap: 0;
    display: none;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.mobile-open {
    display: flex;
  }

  .nav-links a {
    padding: 14px 18px;
    border-top: 1px solid rgba(255,255,255,0.05);
  }
}

@media (max-width: 768px) {
  .profile-name-text {
    display: none;
  


/* =========================
   PROFILE MENU
========================= */

  position: absolute;
  right: 0;
  top: 110%;
  min-width: 200px;
  max-height: 70vh;          /* 🔥 prevents overflow */
  overflow-y: auto;          /* 🔥 scroll inside */
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 6px 0;
  display: none;
  z-index: 999;
}}

.profile-menu.show {
  display: block;
}

.profile-menu button {
  background: none;
  border: none;
  color: var(--text);
  padding: 12px 16px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
}

.profile-menu button:hover {
  background: rgba(56,189,248,.12);
}

@media (max-width: 768px) {

  .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .profile-menu {
    right: 0;
    left: auto;
    width: 220px;
    max-height: 60vh;  /* Increased for mobile to show logout button */
  }

}




.profile-panel-footer {
  padding-bottom: 20px;
}


/* =====================================================
   PROFILE SELECT PAGE
===================================================== */

.profile-select-page {
  background: radial-gradient(circle at top, #0f2742, #081726 60%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-select-container {
  text-align: center;
  max-width: 1000px;
  width: 100%;
  padding: 40px 20px;
}

.profile-select-title {
  font-size: 34px;
  font-weight: 700;
  margin-bottom: 60px;
}

.profile-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 50px;
}

.profile-card {
  width: 160px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all .25s ease;
}

.profile-card:hover {
  transform: scale(1.08);
}

.profile-avatar-lg {
  width: 150px;
  height: 150px;
  border-radius: 22px;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  font-weight: 700;
  margin-bottom: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
  transition: all .25s ease;
}

.profile-card:hover .profile-avatar-lg {
  box-shadow: 0 25px 60px rgba(56,189,248,.45);
}

.profile-avatar-add {
  background: #0f1f33;
  border: 2px dashed #38bdf8;
}

.profile-name-lg {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  opacity: .9;
}

.profile-primary-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  margin-top: 8px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  white-space: nowrap;
}

[data-theme="light"] .profile-primary-badge {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.profile-edit-btn {
  position: absolute;
  top: -7px;
  right: 8px;
  width: auto;
  height: auto;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  transform: rotate(-15deg);
  z-index: 10;
}

.profile-edit-btn:hover {
  transform: rotate(-15deg) scale(1.15);
}

.profile-edit-btn img {
  width: 22px;
  height: 22px;
  filter: brightness(0) invert(1);
  transition: all 0.2s ease;
}

.profile-edit-btn:hover img {
  filter: brightness(0) invert(1) drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
}

[data-theme="light"] .profile-edit-btn img {
  filter: brightness(0);
}

[data-theme="light"] .profile-edit-btn:hover img {
  filter: brightness(0) drop-shadow(0 0 4px rgba(0, 0, 0, 0.3));
}

/* Custom Tooltip for Edit Button */
.profile-edit-btn::after {
  content: attr(title);
  position: absolute;
  top: 50%;
  left: 100%;
  margin-left: 8px;
  margin-top: -12px;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: rotate(15deg) translateX(5px);
  transition: all 0.2s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.profile-edit-btn:hover::after {
  opacity: 1;
  transform: rotate(15deg) translateX(0);
}

[data-theme="light"] .profile-edit-btn::after {
  background: rgba(15, 23, 42, 0.95);
  color: white;
}

.profile-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.profile-modal-box {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 32px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.profile-modal-box h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 24px 0;
  color: #ffffff;
}

.profile-modal-box input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s ease;
  margin-bottom: 24px;
}

.profile-modal-box input:focus {
  border-color: #38bdf8;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.profile-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.profile-modal-actions .btn {
  min-width: 100px;
}

[data-theme="light"] .profile-modal-box {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .profile-modal-box h2 {
  color: #0f172a;
}

[data-theme="light"] .profile-modal-box input {
  border-color: rgba(0, 0, 0, 0.15);
  background: rgba(0, 0, 0, 0.03);
  color: #0f172a;
}

[data-theme="light"] .profile-modal-box input:focus {
  border-color: #0ea5e9;
  background: rgba(0, 0, 0, 0.05);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.profile-modal.hidden {
  display: none;
}

.profile-modal-box {
  background: var(--card);
  padding: 32px;
  border-radius: 20px;
  width: 380px;
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  text-align: center;
}

.profile-modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.profile-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #071b2e;
  padding: 14px 22px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
  z-index: 4000;
}

/* Mobile */
@media (max-width: 768px) {

  .profile-select-title {
    font-size: 26px;
    margin-bottom: 40px;
  }

  .profile-avatar-lg {
    width: 120px;
    height: 120px;
    font-size: 36px;
  }

  .profile-card {
    width: 130px;
  }

  .profile-grid {
    gap: 30px;
  }

  .profile-modal-box {
    width: 90%;
  }
}



/* =========================
   PREMIUM THEME SWITCH
========================= */

.theme-switch {
  position: relative;
  width: 48px;
  height: 26px;
  display: inline-block;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
/* slider  */

.theme-switch .slider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  font-size: 12px;
}

.theme-switch .icon {
  pointer-events: none;
  opacity: 0.6;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-style: normal;
}

.theme-switch input:checked + .slider .sun {
  opacity: 1;
}

.theme-switch input:not(:checked) + .slider .moon {
  opacity: 1;
}

.theme-switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
  transition: .3s ease;
  border: 1px solid var(--border);
}

.theme-switch .slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  top: 2.5px;
  background: white;
  border-radius: 50%;
  transition: .3s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,.3);
}

/* Checked (Light Mode Active) */
.theme-switch input:checked + .slider {
  background: #2563eb;
}

.theme-switch input:checked + .slider::before {
  transform: translateX(22px);
}


/* ===============================
   PREMIUM HAMBURGER
=============================== */

.mobile-menu-btn {
  width: 32px;
  height: 28px;
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
}

.mobile-menu-btn span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--text);
  transition: .3s ease;
  border-radius: 2px;
}

.mobile-menu-btn span:nth-child(1) { top: 4px; }
.mobile-menu-btn span:nth-child(2) { top: 12px; }
.mobile-menu-btn span:nth-child(3) { top: 20px; }

/* Open state */
.mobile-menu-btn.open span:nth-child(1) {
  transform: rotate(45deg);
  top: 12px;
}

.mobile-menu-btn.open span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.open span:nth-child(3) {
  transform: rotate(-45deg);
  top: 12px;
}

/* ===============================
   NETFLIX LEVEL DRAWER
=============================== */

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: .35s ease;
  z-index: 90;
}

.nav-overlay.show {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 768px) {

  .nav-links.drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 270px;

    display: flex;
    flex-direction: column;
    gap: 12px;

    padding: 90px 24px 24px;

    background: linear-gradient(180deg,#081726,#050f18);

    transform: translateX(-100%);
    transition: transform .4s cubic-bezier(.25,.8,.25,1);

    box-shadow: 10px 0 40px rgba(0,0,0,.6);
    z-index: 100;
  }

  .nav-links.drawer.mobile-open {
    transform: translateX(0);
  }

  .nav-links.drawer a {
    font-size: 18px;
    padding: 14px;
    border-radius: 12px;
    transition: .2s ease;
  }

  .nav-links.drawer a:hover {
    background: rgba(56,189,248,.18);
    transform: translateX(6px);
  }

  .nav-links.drawer a.active {
    background: rgba(56,189,248,.22);
  }

  /* Light theme */
  [data-theme="light"] .nav-links.drawer {
    background: white;
    border-right: 1px solid #e2e8f0;
    box-shadow: 10px 0 40px rgba(0,0,0,.08);
  }

  [data-theme="light"] .nav-links.drawer a.active {
    background: #e8f0ff;
  }
}

body.drawer-open .container,
body.drawer-open .nav {
  transform: scale(.97);
  transition: .35s ease;
}

body.drawer-open {
  overflow: hidden;
}

.clock {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(56,189,248,.3);
  border-top: 4px solid #38bdf8;
  border-radius: 50%;
  margin: auto;
  animation: spin 1.2s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* Brand container */
.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

/* Logo */
.nav-logo {
  height: 34px;        /* Desktop */
  width: auto;
  object-fit: contain;
  transition: transform 0.2s ease;
}

/* Subtle premium hover */
.brand-link:hover .nav-logo {
  transform: scale(1.03);
}

/* Mobile sizing */
@media (max-width: 768px) {
  .nav-logo {
    height: 28px;
  }
}

.upgrade-link {
  display: block;
  color: #000;
  font-weight: 700;
  text-align: center;
  transition: .2s ease;
}

.upgrade-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(56,189,248,.4);
}

.drawer-close {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  margin-bottom: 20px;
  cursor: pointer;
  color: var(--text);
}

@media (max-width: 768px) {
  .drawer-close {
    display: block;
  }
}

/* =========================
   FOOTER PREMIUM
========================= */

.app-footer {
  margin-top: 70px;
  padding: 50px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
  width: 100%;
}

[data-theme="light"] .app-footer {
  background: rgba(255,255,255,0.8);
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: center;
  text-align: center;
}

.footer-logo {
  height: 40px;
}

.footer-tagline {
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  font-size: 14px;
  color: var(--muted);
  transition: .2s ease;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-social {
  display: flex;
  gap: 20px;
}

.footer-social a {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(56,189,248,.1);
  color: var(--accent);
  transition: .2s ease;
}

.footer-social a:hover {
  transform: translateY(-3px);
  background: var(--accent);
  color: #000;
  box-shadow: 0 10px 25px rgba(56,189,248,.4);
}

.footer-social svg {
  width: 18px;
  height: 18px;
}

.footer-copy {
  font-size: 13px;
  color: var(--muted);
  opacity: .7;
}

/* Mobile spacing */
@media (max-width: 768px) {
  .footer-links {
    gap: 16px;
  }
}

.footer-divider {
  max-width: var(--max);
  margin: 0 auto 40px auto;
  height: 2px;
  border-radius: 2px;

  background: linear-gradient(
    270deg,
    #38bdf8,
    #6366f1,
    #22d3ee,
    #38bdf8
  );
  background-size: 400% 400%;
  animation: gradientMove 8s ease infinite;

  box-shadow: 0 0 18px rgba(56, 189, 248, 0.5);
}

@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}



/* =========================
   SOCIAL ICONS (SVG)
========================= */

.footer-social {
  display: flex;
  gap: 20px;
}

.footer-social a {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(56,189,248,.1);
  transition: .25s ease;
}

.footer-social a:hover {
  transform: translateY(-3px);
  background: var(--accent);
  box-shadow: 0 10px 25px rgba(56,189,248,.4);
}

.social-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(62%) sepia(71%) 
          saturate(416%) hue-rotate(165deg) brightness(95%) contrast(92%);
  transition: .25s ease;
}

/* On hover turn white */
.footer-social a:hover .social-icon {
  filter: brightness(0) invert(1);
}

/* Light theme adjustment */
[data-theme="light"] .social-icon {
  filter: none;
}

.now-playing {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.now-playing::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0% { transform: scale(.9); opacity:.7 }
  50% { transform: scale(1.4); opacity:1 }
  100% { transform: scale(.9); opacity:.7 }
}

/* ACTIVE TOPIC - REMOVED DUPLICATE */
.item.active {

  background: linear-gradient(
      90deg,
      rgba(56,189,248,.18),
      rgba(56,189,248,.06)
  );

  border-left: 3px solid var(--accent);

  box-shadow:
      0 0 0 1px rgba(56,189,248,.2),
      0 8px 18px rgba(56,189,248,.08);

  transform: translateX(2px);

}

/* HOVER */
.item:hover {

  background: rgba(56,189,248,.08);
  transform: translateX(2px);

}

.topic-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.item.active .topic-title {
  font-weight: 600;
}

/* new design */

.page-loader{
  position:fixed;
  inset:0;
  background:#050f18;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:20px;
  z-index:9999;
}

/* video placeholder */

.loader-video{
  width:720px;
  height:405px;
  border-radius:16px;

  background:linear-gradient(
      110deg,
      #0a1a2c 8%,
      #0f2740 18%,
      #0a1a2c 33%
  );

  background-size:200% 100%;
  animation:loaderShimmer 1.5s infinite;
}

/* text placeholders */

.loader-lines{
  width:300px;
}

.loader-lines div{
  height:12px;
  border-radius:8px;
  margin:10px 0;

  background:linear-gradient(
      110deg,
      #0a1a2c 8%,
      #0f2740 18%,
      #0a1a2c 33%
  );

  background-size:200% 100%;
  animation:loaderShimmer 1.5s infinite;
}

.loader-lines div:nth-child(2){
  width:80%;
}

.loader-lines div:nth-child(3){
  width:60%;
}

@keyframes loaderShimmer{
  to{
    background-position:-200% 0;
  }
}

/* ===========================
   CERTIFICATE CARDS (My Certificates Page)
=========================== */

.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 28px;
  margin-top: 30px;
}

.cert-card {
  background: linear-gradient(180deg, #071b2e, #041018);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  overflow: hidden;
  transition: 0.25s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

[data-theme="light"] .cert-card {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid rgba(0,0,0,0.1);
}

.cert-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 25px rgba(56,189,248,.35);
}

[data-theme="light"] .cert-card:hover {
  box-shadow: 0 0 25px rgba(56,189,248,.25);
}

.cert-preview-wrapper {
  width: 100%;
  aspect-ratio: 1.414 / 1;
  background: #111;
  overflow: hidden;
}

[data-theme="light"] .cert-preview-wrapper {
  background: #e5e7eb;
}

.cert-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cert-body {
  padding: 18px;
}

.cert-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
}

.cert-course {
  font-size: 14px;
  opacity: 0.7;
  margin-bottom: 12px;
}

.cert-details {
  font-size: 13px;
  line-height: 1.6;
  opacity: 0.75;
}

.cert-id {
  font-family: monospace;
  font-size: 12px;
  opacity: 0.6;
  margin-top: 8px;
}

.status-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(34,197,94,0.15);
  border: 1px solid rgba(34,197,94,0.4);
  color: #22c55e;
}

[data-theme="light"] .status-badge {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  color: #16a34a;
}

.preview-fallback {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  background: linear-gradient(135deg, rgba(56,189,248,0.1), rgba(0,0,0,0.6));
}

[data-theme="light"] .preview-fallback {
  color: rgba(0,0,0,0.5);
  background: linear-gradient(135deg, rgba(56,189,248,0.1), rgba(0,0,0,0.05));
}

@media (max-width: 768px) {
  .cert-grid {
    grid-template-columns: 1fr;
  }
}

/* ===========================
   LOCKED COURSE STYLES
=========================== */

.course-locked {
  position: relative;
}

.locked-img {
  filter: blur(3px) brightness(0.6);
  opacity: 0.5;
}

[data-theme="light"] .locked-img {
  filter: blur(3px) brightness(1.2) grayscale(0.3);
  opacity: 0.6;
}

.lock-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 16px;
}

/* ===========================
   EMI DUE BANNER
=========================== */

.emi-due-card {
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.1), rgba(249, 115, 22, 0.1)) !important;
  border: 1px solid rgba(251, 146, 60, 0.3) !important;
}

[data-theme="light"] .emi-due-card {
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.15), rgba(249, 115, 22, 0.15)) !important;
  border: 1px solid rgba(251, 146, 60, 0.4) !important;
}

/* Account Page */
.account-page {
    max-width: 600px;
    margin: 80px auto;
    padding: 0 20px;
}

.account-page h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 40px;
    color: #e5e7eb;
    text-align: center;
}

.account-section {
    margin-bottom: 32px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.account-section h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #e5e7eb;
}

.edit-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.edit-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}

.edit-btn svg {
    flex-shrink: 0;
}

.info-card,
.password-card {
    background: rgba(31, 41, 55, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 16px;
    padding: 28px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(75, 85, 99, 0.3);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: #9ca3af;
    font-size: 14px;
}

.info-value {
    color: #e5e7eb;
    font-size: 14px;
    font-weight: 500;
}

.info-edit-input {
    flex: 1;
    padding: 8px 12px;
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 8px;
    font-size: 14px;
    color: #e5e7eb;
    transition: all 0.3s ease;
}

.info-edit-input:focus {
    outline: none;
    border-color: #60a5fa;
    background: rgba(17, 24, 39, 0.95);
}

.edit-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(75, 85, 99, 0.3);
}

.cancel-btn,
.save-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-btn {
    background: transparent;
    border: 1px solid rgba(156, 163, 175, 0.3);
    color: #9ca3af;
}

.cancel-btn:hover {
    background: rgba(156, 163, 175, 0.1);
    border-color: rgba(156, 163, 175, 0.5);
}

.save-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    color: white;
}

.save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #e5e7eb;
    font-size: 14px;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 12px;
    font-size: 15px;
    color: #e5e7eb;
    transition: all 0.3s ease;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    width: 100%;
    padding-right: 50px;
}

.toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    transition: color 0.2s;
    user-select: none;
}

.toggle-password:hover {
    color: #e5e7eb;
}

.input-group input:focus {
    outline: none;
    border-color: #60a5fa;
    background: rgba(17, 24, 39, 0.95);
}

.input-hint {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

.primary-btn {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .account-page {
        margin: 40px auto;
    }
    
    .account-page h1 {
        font-size: 28px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .edit-btn {
        width: 100%;
        justify-content: center;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .info-edit-input {
        width: 100%;
    }
    
    .edit-actions {
        flex-direction: column;
    }
    
    .cancel-btn,
    .save-btn {
        width: 100%;
    }
    
    .info-card,
    .password-card {
        padding: 20px;
    }
}

/* Light Theme - Account Page */
[data-theme="light"] .account-page h1,
[data-theme="light"] .account-section h2 {
    color: #1f2937;
}

[data-theme="light"] .edit-btn {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

[data-theme="light"] .edit-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.5);
}

[data-theme="light"] .info-card,
[data-theme="light"] .password-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(229, 231, 235, 0.8);
}

[data-theme="light"] .info-row {
    border-bottom-color: rgba(229, 231, 235, 0.6);
}

[data-theme="light"] .info-label {
    color: #6b7280;
}

[data-theme="light"] .info-value {
    color: #1f2937;
}

[data-theme="light"] .info-edit-input {
    background: rgba(249, 250, 251, 0.8);
    border-color: rgba(209, 213, 219, 0.6);
    color: #1f2937;
}

[data-theme="light"] .info-edit-input:focus {
    border-color: #3b82f6;
    background: rgba(255, 255, 255, 0.95);
}

[data-theme="light"] .edit-actions {
    border-top-color: rgba(229, 231, 235, 0.6);
}

[data-theme="light"] .cancel-btn {
    border-color: rgba(156, 163, 175, 0.4);
    color: #6b7280;
}

[data-theme="light"] .cancel-btn:hover {
    background: rgba(156, 163, 175, 0.1);
    border-color: rgba(156, 163, 175, 0.6);
}

[data-theme="light"] .input-group label {
    color: #1f2937;
}

[data-theme="light"] .input-group input {
    background: rgba(249, 250, 251, 0.8);
    border-color: rgba(209, 213, 219, 0.6);
    color: #1f2937;
}

[data-theme="light"] .input-group input:focus {
    border-color: #3b82f6;
    background: rgba(255, 255, 255, 0.95);
}

[data-theme="light"] .input-hint {
    color: #9ca3af;
}

[data-theme="light"] .toggle-password {
    color: #6b7280;
}

[data-theme="light"] .toggle-password:hover {
    color: #1f2937;
}

/* Dark Theme - Account Page */
[data-theme="dark"] .account-page h1,
[data-theme="dark"] .account-section h2 {
    color: #e5e7eb;
}

[data-theme="dark"] .info-card,
[data-theme="dark"] .password-card {
    background: rgba(31, 41, 55, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.3);
}

[data-theme="dark"] .info-row {
    border-bottom-color: rgba(75, 85, 99, 0.3);
}

[data-theme="dark"] .info-label {
    color: #9ca3af;
}

[data-theme="dark"] .info-value {
    color: #e5e7eb;
}

[data-theme="dark"] .input-group label {
    color: #e5e7eb;
}

[data-theme="dark"] .input-group input {
    background: rgba(17, 24, 39, 0.8);
    border-color: rgba(75, 85, 99, 0.5);
    color: #e5e7eb;
}

[data-theme="dark"] .input-group input:focus {
    border-color: #60a5fa;
    background: rgba(17, 24, 39, 0.95);
}

[data-theme="dark"] .input-hint {
    color: #6b7280;
}

[data-theme="dark"] .toggle-password {
    color: #9ca3af;
}

[data-theme="dark"] .toggle-password:hover {
    color: #e5e7eb;
}
/* Badge variants */
.badge.success {
  background-color: #10b981;
  color: white;
}

.badge.warning {
  background-color: #f59e0b;
  color: white;
}

.badge.error {
  background-color: #ef4444;
  color: white;
}

/* EMI Status Card */
#emiStatusCard {
  border-left: 4px solid #3b82f6;
}

#emiStatusCard .badge.success {
  border-left-color: #10b981;
}

#emiStatusCard .badge.warning {
  border-left-color: #f59e0b;
}

#emiStatusCard .badge.error {
  border-left-color: #ef4444;
}