/* Basic reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #fdf5ff;
  color: #1a1333;
  line-height: 1.5;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 260px;
  min-height: 100vh;
}

/* Two-column layout (no right sidebar) */
.layout.no-right {
  grid-template-columns: 220px minmax(0, 1fr);
}

/* INNER WRAPPER FOR MAIN CONTENT */
.main-content {
  padding: 24px 24px 32px;
  overflow-y: auto;
}

.main-inner {
  max-width: 1120px;
  margin: 0 auto;
}

/* TOP BAR */
.main-topbar {
  background: #ffffff;
  border-radius: 16px;
  padding: 12px 18px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 12px rgba(54, 16, 97, 0.06);
}

.main-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.main-topbar-tag {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f2e9ff;
  color: #5b2abf;
  font-weight: 600;
}

.main-topbar-title {
  font-size: 1rem;
  font-weight: 600;
}

.main-topbar-sub {
  font-size: 0.85rem;
  color: #7c6a9d;
}

/* LEFT SIDEBAR */
.sidebar-left {
  background: #ffffff;
  border-right: 1px solid #f0e5ff;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, #8338ec, #ff006e);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
}

.brand-name {
  font-weight: 700;
  font-size: 1.1rem;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: #6b5b95;
  font-size: 0.95rem;
}

.nav-item:hover {
  background: #f5edff;
}

.nav-item-active {
  background: #f0e3ff;
  color: #5b2abf;
  font-weight: 600;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #d0b4ff;
}

/* PAGE SECTIONS */
.page-section {
  margin-top: 40px;
}

.page-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.page-section p.section-lead {
  font-size: 0.95rem;
  color: #7c6a9d;
  margin-bottom: 16px;
}

/* Generic card for sections */
.section-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 20px 20px 22px;
  box-shadow: 0 6px 18px rgba(54, 16, 97, 0.05);
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 8px;
}

.hero-card {
  padding: 22px 22px 24px;
  border-radius: 20px;
  color: #fff;
  box-shadow: 0 8px 22px rgba(54, 16, 97, 0.15);
}

.hero-primary {
  background: linear-gradient(135deg, #7b2cff, #f72585);
}

.hero-secondary {
  background: linear-gradient(135deg, #ff9f1c, #ff577f);
}

.hero-card h2 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.hero-card p {
  font-size: 0.95rem;
  margin-bottom: 16px;
}

/* Buttons */
.btn-solid,
.btn-outline {
  border-radius: 999px;
  border: none;
  padding: 9px 20px;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-solid {
  background: #fff;
  color: #5b2abf;
  font-weight: 600;
}

.btn-outline {
  background: transparent;
  border: 1px solid #fff;
  color: #fff;
}

.btn-full {
  width: 100%;
  margin-top: 14px;
}

/* Home feature grids */
.home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 8px;
}

.home-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 18px 18px 20px;
  box-shadow: 0 6px 16px rgba(54, 16, 97, 0.04);
  font-size: 0.95rem;
  color: #1a1333;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 150px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.home-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.home-card p {
  font-size: 0.9rem;
  color: #7c6a9d;
}

.home-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(54, 16, 97, 0.09);
}

/* Courses section / generic course card */
.courses-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.courses-header h2 {
  font-size: 1.2rem;
}

.courses-subtitle {
  font-size: 0.85rem;
  color: #8b7aa8;
}

.courses-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.course-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 18px 18px 20px;
  box-shadow: 0 6px 16px rgba(54, 16, 97, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.course-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(54, 16, 97, 0.1);
}

.course-top {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.course-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: #e7ddff;
  color: #5b2abf;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.course-tagline {
  font-size: 0.9rem;
  color: #7c6a9d;
}

.course-meta {
  font-size: 0.85rem;
  color: #6c5a8e;
  margin-bottom: 10px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #f2e9ff;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7b2cff, #f72585);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Topic pills for C course section */
.topics-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.topics-list li {
  list-style: none;
  padding: 6px 11px;
  border-radius: 999px;
  background: #f2e9ff;
  font-size: 0.85rem;
  color: #5b2abf;
}

/* Founder message box refinement */
.founder-box {
  border-left: 4px solid #7b2cff;
}

/* Placeholder box for other pages */
.placeholder-box {
  background: #ffffff;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 6px 16px rgba(54, 16, 97, 0.05);
  font-size: 0.95rem;
  color: #7c6a9d;
}

.placeholder-box strong {
  color: #5b2abf;
}

/* RIGHT SIDEBAR (only used on dashboard page) */
.sidebar-right {
  background: #fef8ff;
  border-left: 1px solid #f0e5ff;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Streak */
.streak-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 14px 14px 16px;
  box-shadow: 0 4px 12px rgba(54, 16, 97, 0.04);
}

.streak-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.streak-row h4 {
  font-size: 0.9rem;
  color: #7c6a9d;
}

.streak-row p {
  font-weight: 600;
  margin-top: 4px;
}

.streak-calendar {
  border-top: 1px dashed #f0e5ff;
  padding-top: 10px;
}

.calendar-header {
  font-size: 0.85rem;
  color: #7c6a9d;
  margin-bottom: 6px;
}

.calendar-days {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #9a87c4;
  margin-bottom: 6px;
}

.calendar-dots {
  display: flex;
  justify-content: space-between;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ece2ff;
}

.dot.active {
  background: #7b2cff;
}

/* Leaderboard */
.leaderboard-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 14px 14px 16px;
  box-shadow: 0 4px 12px rgba(54, 16, 97, 0.04);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.leaderboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.leaderboard-header h4 {
  font-size: 0.95rem;
}

.leaderboard-tabs {
  display: flex;
  gap: 6px;
}

.tab-btn {
  border-radius: 999px;
  border: none;
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  background: transparent;
  color: #7c6a9d;
}

.tab-active {
  background: #f2e9ff;
  color: #5b2abf;
  font-weight: 600;
}

.leaderboard-list {
  list-style: none;
  margin-top: 6px;
  margin-bottom: 10px;
  flex: 1;
  overflow-y: auto;
  font-size: 0.83rem;
}

.leaderboard-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

.leaderboard-item span:first-child {
  color: #7c6a9d;
}

.leaderboard-item span:last-child {
  color: #f0842f;
}

.leaderboard-footer {
  font-size: 0.8rem;
  color: #7c6a9d;
  border-top: 1px dashed #f0e5ff;
  padding-top: 6px;
}

/* Bottom CTA banner spacing */
.cta-banner {
  margin-top: 40px;
}

/* Responsive adjustments */
@media (max-width: 1080px) {
  .layout {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .layout.no-right {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .layout,
  .layout.no-right {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar-left {
    display: none; /* simple for now; later we can add mobile nav */
  }

  .main-content {
    padding: 16px 16px 24px;
  }

  .home-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* DASHBOARD – Courses grid: 3 square-ish cards per row */
.dashboard-courses-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

/* Base dashboard course card */
.dashboard-course-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 1 / 1; /* makes cards more square */
}

/* Inner content area so button/footer sits at bottom */
.course-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Gradient course button, matching hero style */
.btn-course-gradient {
  margin-top: 12px;
  border-radius: 999px;
  border: none;
  padding: 9px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #7b2cff, #f72585);
  color: #fff;
  box-shadow: 0 6px 16px rgba(54, 16, 97, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-course-gradient:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(54, 16, 97, 0.25);
}

/* Disabled / Coming soon card */
.course-card-disabled {
  /* no global opacity so text stays readable */
  box-shadow: 0 4px 10px rgba(54, 16, 97, 0.03);
}

/* REMOVE this old rule if you still have it:
.course-card-disabled .course-card-content {
  pointer-events: none;
}
*/

.course-coming-soon {
  margin-top: 10px;
  border-radius: 999px;
  padding: 7px 12px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  background: #f3efff;
  color: #a39ac2;
  cursor: default;           /* looks disabled */
}


/* Placeholder slot for future courses */
.course-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b5a8d8;
  font-size: 0.9rem;
  font-weight: 500;
  background: #fbf7ff;
  border: 1px dashed #e0d2ff;
}

.course-card-placeholder-inner {
  text-align: center;
}

/* Slightly stronger hover only for active cards */
.dashboard-course-card:not(.course-card-disabled):not(.course-card-placeholder):hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(54, 16, 97, 0.1);
}

/* ---------- RIGHT SIDEBAR ENHANCEMENTS ---------- */

/* Streak card */
.streak-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 16px 14px 18px;
  box-shadow: 0 6px 18px rgba(54, 16, 97, 0.06);
}

.streak-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 10px;
}

/* Two mini cards: current & longest streak */
.streak-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.streak-stat-card {
  background: #f8f2ff;
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.streak-label {
  font-size: 0.75rem;
  color: #8a7bb0;
}

.streak-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: #5b2abf;
}

/* Calendar header & grid */
.calendar-header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.calendar-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #7c6a9d;
}

.calendar-subtitle {
  font-size: 0.75rem;
  color: #b19fd2;
}

/* Days row unchanged but used with grid below */
.calendar-days {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #9a87c4;
  margin-bottom: 6px;
}

/* Clean 7-column grid for dots */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-grid .dot {
  margin: 0;
}

/* Leaderboard tabs pill */
.leaderboard-tabs-wrapper {
  background: #f2e9ff;
  border-radius: 999px;
  padding: 2px;
  display: inline-flex;
  gap: 4px;
}

.tab-btn {
  min-width: 60px;
}

/* Active tab stands out more */
.tab-active {
  background: #ffffff;
  color: #5b2abf;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(54, 16, 97, 0.18);
}

/* Leaderboard list spacing + dividers */
.leaderboard-list {
  margin-top: 8px;
  margin-bottom: 10px;
  padding-top: 2px;
}

.leaderboard-item {
  padding: 6px 0;
  border-top: 1px dashed #f0e5ff;
}

.leaderboard-item:first-child {
  border-top: none;
}

/* Highlight user rank bar */
.leaderboard-footer-highlight {
  margin-top: 2px;
  border-radius: 12px;
  padding: 8px 10px;
  background: #fbf7ff;
  color: #5b2abf;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.8rem;
}

/* ---------- C COURSE PAGE LAYOUT ---------- */

.course-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
}

/* Left column: module + lesson list */
.course-sidebar {
  background: #ffffff;
  border-radius: 18px;
  padding: 16px 14px 18px;
  box-shadow: 0 6px 18px rgba(54, 16, 97, 0.06);
}

.course-sidebar-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: #5b2abf;
}

.module-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.module-block {
  border-radius: 12px;
  background: #fbf7ff;
  padding: 8px 8px 10px;
}

.module-title-btn {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 600;
  color: #7c6a9d;
  margin-bottom: 6px;
  cursor: default;
}

.module-lesson-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Lesson links */
.lesson-link-btn {
  width: 100%;
  text-align: left;
  border-radius: 999px;
  border: none;
  padding: 6px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  background: #f5edff;
  color: #6b5b95;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lesson-link-btn:hover {
  background: #efe0ff;
}

.lesson-link-active {
  background: linear-gradient(135deg, #7b2cff, #f72585);
  color: #ffffff;
  font-weight: 600;
}

.lesson-link-completed {
  position: relative;
}

.lesson-link-completed::after {
  content: "✓";
  font-size: 0.8rem;
  margin-left: 6px;
}

/* Right column: lesson meta + iframe */
.lesson-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lesson-card h2 {
  margin-bottom: 4px;
}

.lesson-actions {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.lesson-nav-btn {
  min-width: 140px;
}

.lesson-complete-btn {
  min-width: 180px;
}

/* Iframe wrapper */
.lesson-frame-wrapper {
  margin-top: 4px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(54, 16, 97, 0.08);
  background: #ffffff;
  min-height: 520px;
}

.lesson-frame-wrapper iframe {
  width: 100%;
  border: none;
  min-height: 520px;
}

/* Responsive */
@media (max-width: 960px) {
  .course-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .lesson-actions {
    justify-content: flex-start;
  }
}
