/* ICFESSK - Learning Styles (Dashboard, Hub, Module, Lesson) */
/* Extracted from pages.css - V7 CSS cleanup */

/* Ã¢â€â‚¬Ã¢â€â‚¬ Dashboard Layout Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬ */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-white);
}

.sidebar {
  width: 260px;
  background: var(--bg-white);
  border-right: 2px solid var(--border-subtle);
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: hidden;
}

.sidebar-logo {
  padding: 0 12px;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: var(--fw-bold);
  font-size: 1.1rem;
}

.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--violet);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.sidebar-logo-icon span {
  font-size: 20px;
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.sidebar-logo-sub {
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.sidebar-link-indicator {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 4px;
  height: 60%;
  border-radius: 0 4px 4px 0;
  background: var(--violet);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0;
}

.sidebar-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: var(--violet-light);
  color: var(--violet);
  font-weight: var(--fw-semi);
}

.sidebar-link.active .sidebar-link-indicator {
  transform: translateY(-50%) scaleY(1);
  opacity: 1;
}

.sidebar-link.active .icon-sm {
  font-variation-settings: 'FILL' 1;
}

/* ── Active & Hover States by Area ── */
.sidebar-link[data-area="mat"].active {
  background: rgba(0, 229, 255, 0.12);
  color: var(--area-mat);
}

.sidebar-link[data-area="mat"].active .sidebar-link-indicator {
  background: var(--area-mat);
}

.sidebar-link[data-area="mat"]:hover:not(.active) {
  background: rgba(0, 229, 255, 0.05);
  color: var(--area-mat);
}

.sidebar-link[data-area="lec"].active {
  background: rgba(255, 152, 0, 0.12);
  color: var(--area-lec);
}

.sidebar-link[data-area="lec"].active .sidebar-link-indicator {
  background: var(--area-lec);
}

.sidebar-link[data-area="lec"]:hover:not(.active) {
  background: rgba(255, 152, 0, 0.05);
  color: var(--area-lec);
}

.sidebar-link[data-area="soc"].active {
  background: rgba(211, 47, 47, 0.12);
  color: var(--area-soc);
}

.sidebar-link[data-area="soc"].active .sidebar-link-indicator {
  background: var(--area-soc);
}

.sidebar-link[data-area="soc"]:hover:not(.active) {
  background: rgba(211, 47, 47, 0.05);
  color: var(--area-soc);
}

.sidebar-link[data-area="nat"].active {
  background: rgba(0, 200, 83, 0.12);
  color: var(--area-nat);
}

.sidebar-link[data-area="nat"].active .sidebar-link-indicator {
  background: var(--area-nat);
}

.sidebar-link[data-area="nat"]:hover:not(.active) {
  background: rgba(0, 200, 83, 0.05);
  color: var(--area-nat);
}

.sidebar-link[data-area="eng"].active {
  background: rgba(98, 0, 234, 0.12);
  color: var(--area-eng);
}

.sidebar-link[data-area="eng"].active .sidebar-link-indicator {
  background: var(--area-eng);
}

.sidebar-link[data-area="eng"]:hover:not(.active) {
  background: rgba(98, 0, 234, 0.05);
  color: var(--area-eng);
}

.sidebar-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 16px 0;
}

.sidebar-link--soon {
  opacity: 0.5;
  pointer-events: none;
}

/* ── Coming Soon — Sidebar & Drawer Badges ── */
.sidebar-link--coming-soon {
  opacity: 0.55;
}

.sidebar-link--coming-soon:hover {
  opacity: 0.7;
}

.sidebar-coming-soon-badge,
.drawer-coming-soon-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.6rem;
  font-weight: var(--fw-extra, 800);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 6px;
  background: linear-gradient(135deg, #7C3AED22, #6C2BFF18);
  color: var(--violet, #6C2BFF);
  border: 1px solid rgba(108, 43, 255, 0.15);
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}

.drawer-link--coming-soon {
  opacity: 0.55;
}

.drawer-link--coming-soon:hover {
  opacity: 0.7;
}

/* ── Coming Soon — Full Page ── */
.coming-soon-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 40px 20px;
}

.coming-soon-card {
  text-align: center;
  max-width: 440px;
  padding: 48px 36px;
  background: var(--bg-white, #fff);
  border-radius: 50%;
  border: 1px solid var(--border-subtle, #e5e7eb);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
}

.coming-soon-icon-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(108, 43, 255, 0.1), rgba(108, 43, 255, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.coming-soon-icon {
  font-size: 40px;
  color: var(--violet, #6C2BFF);
}

.coming-soon-title {
  font-size: 1.5rem;
  font-weight: var(--fw-extra, 800);
  color: var(--text-primary, #1a1a2e);
  margin-bottom: 8px;
}

.coming-soon-desc {
  font-size: 0.95rem;
  color: var(--text-secondary, #6b7280);
  line-height: 1.5;
  margin-bottom: 24px;
}

.coming-soon-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #F0EBFF, #E8E0FF);
  color: var(--violet, #6C2BFF);
  font-weight: var(--fw-bold, 700);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.coming-soon-sub {
  font-size: 0.8rem;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 24px;
  line-height: 1.4;
}

.coming-soon-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  background: var(--violet, #6C2BFF);
  color: white;
  font-weight: var(--fw-semi, 600);
  font-size: 0.9rem;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.coming-soon-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(108, 43, 255, 0.3);
}

/* ── Coming Soon — Side Card Variant ── */
.learn-side-card--coming-soon {
  border: 1px dashed var(--border-subtle, #e5e7eb);
  background: var(--bg-secondary, #f9fafb);
}

/* Sidebar Bottom Panels */
.sidebar-alerts-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-secondary);
  font-weight: var(--fw-semi);
  font-size: 0.9rem;
  margin-bottom: 16px;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  width: 100%;
  transition: background 0.2s;
}

.sidebar-alerts-btn:hover {
  background: var(--bg-hover);
}

.sidebar-user-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--bg-hover);
  border-radius: 16px;
  margin-top: 8px;
}

.sidebar-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid var(--border-subtle);
}

.sidebar-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-bold);
  color: var(--text-secondary);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  margin: 0 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-user-name {
  font-size: 0.9rem;
  font-weight: var(--fw-bold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.sidebar-user-plan {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.sidebar-user-settings {
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: transparent;
  display: flex;
}

.sidebar-user-settings:hover {
  color: var(--violet);
}


/* Main Content Container */
.main-content {
  flex: 1;
  padding: 48px;
  max-width: 1200px;
  margin: 0 auto;
}

.dashboard-layout:has(.shell-side-col) {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  align-items: stretch;
}

.dashboard-layout:has(.shell-side-col) .main-content {
  min-width: 0;
  max-width: none;
  height: 100vh;
  margin: 0;
  padding: 48px 28px;
  overflow-y: auto;
  overflow-x: hidden;
}

.shell-side-col {
  flex: 0 0 360px;
  width: 360px;
  height: 100vh;
  max-height: none;
  padding: 48px 28px 24px 0;
  overflow-y: auto;
  overflow-x: hidden;
  position: sticky;
  top: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.12) transparent;
}

.shell-side-col::-webkit-scrollbar {
  width: 6px;
}

.shell-side-col::-webkit-scrollbar-track {
  background: transparent;
}

.shell-side-col::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}

.shell-stats-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

#view-outlet .learn-topbar .learn-stats-group {
  display: none;
}

#view-outlet .learn-topbar {
  justify-content: flex-start;
}

.dashboard-layout:has(.shell-side-col) #view-outlet .learn-body {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

/* Dashboard Header */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 48px;
}

.dashboard-title {
  font-size: clamp(2rem, 3.5vw, 2.5rem);
  font-weight: var(--fw-extra);
  line-height: 1.2;
  letter-spacing: -1px;
  max-width: 700px;
}

.dashboard-title-highlight {
  color: var(--violet);
}

.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFF0F7;
  color: var(--magenta);
  border: 1px solid #FFE4F0;
  padding: 10px 20px;
  border-radius: 14px;
  font-weight: var(--fw-bold);
  font-size: 1rem;
}

/* Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 32px;
  margin-bottom: 48px;
  align-items: start;
}

/* Plan del Dia Card */
.hero-card {
  background: var(--bg-white);
  border-radius: 50%;
  padding: 40px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 300px;
  height: 300px;
  background: var(--violet-light);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

.hero-badge {
  display: inline-flex;
  background: var(--violet-light);
  color: var(--violet);
  font-size: 0.65rem;
  font-weight: var(--fw-extra);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 24px;
  align-self: flex-start;
  z-index: 1;
}

.hero-title {
  font-size: 1.75rem;
  font-weight: var(--fw-bold);
  margin-bottom: 12px;
  z-index: 1;
  position: relative;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 400px;
  line-height: 1.5;
  z-index: 1;
  position: relative;
}

.hero-btn {
  align-self: flex-start;
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1;
}

/* Side Cards Stack */
.side-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.stats-card {
  background: var(--bg-white);
  border-radius: 50%;
  padding: 32px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
}

.stats-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: var(--fw-bold);
  margin-bottom: 24px;
  color: var(--text-primary);
}

.stats-header .icon-sm {
  color: var(--blue);
}

.stats-score {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 16px;
}

.stats-score-main {
  font-size: 3rem;
  font-weight: var(--fw-extra);
  color: var(--violet);
  line-height: 1;
}

.stats-score-total {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: var(--fw-medium);
}

.stats-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--border-subtle);
  border-radius: 4px;
  margin-bottom: 24px;
  overflow: hidden;
}

.stats-bar-fill {
  height: 100%;
  background: var(--violet);
  border-radius: 4px;
  transition: width 1s ease;
}

.upsell-card {
  background: #FDFBFF;
  border-radius: 50%;
  padding: 24px;
  border: 2px dashed #D6C2FF;
  display: flex;
  align-items: center;
  gap: 20px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
}

.upsell-card:hover {
  background: var(--violet-light);
  border-color: var(--violet);
}

.upsell-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  background: var(--violet);
  color: white;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upsell-content {
  flex: 1;
}

.upsell-title {
  font-weight: var(--fw-bold);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.upsell-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.upsell-arrow {
  color: var(--violet);
}

/* Areas Grid */
.areas-section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 24px;
}

.areas-section-title {
  font-size: 1.25rem;
  font-weight: var(--fw-bold);
}

.areas-section-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.areas-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  align-items: stretch;
}

.area-mini-card {
  background: var(--bg-white);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  min-height: 0;
}

.area-mini-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.area-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  align-self: flex-start;
}

.area-name {
  font-weight: var(--fw-bold);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.area-progress-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.area-progress-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--border-subtle);
  border-radius: 3px;
  overflow: hidden;
}

.area-progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}

/* Dashboard V2 - Coach-Ready Elements */
.coach-mascot-container {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coach-mascot-img {
  height: 88px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(108, 43, 255, 0.15));
}

.coach-bubble {
  position: relative;
  background: #F8F6FF;
  border: 1px solid rgba(108, 43, 255, 0.12);
  border-radius: 16px;
  padding: 16px 20px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
}

.coach-bubble::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 14px;
  height: 14px;
  background: #F8F6FF;
  border-left: 1px solid rgba(108, 43, 255, 0.12);
  border-bottom: 1px solid rgba(108, 43, 255, 0.12);
}

.coach-float-anchor {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
}

/* Gamification Elements */
.score-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(var(--violet) var(--score-deg, 0deg), var(--border-subtle) var(--score-deg, 0deg));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.score-ring::after {
  content: '';
  position: absolute;
  width: 100px;
  height: 100px;
  background: var(--bg-white);
  border-radius: 50%;
}

.score-ring-content {
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}

.score-ring-value {
  font-size: 1.8rem;
  font-weight: var(--fw-extra);
  color: var(--violet);
}

.score-ring-total {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: var(--fw-bold);
}

.streak-visual {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Stagger Animation */
.stagger-in {
  opacity: 0;
  transform: translateY(10px);
  animation: staggerFadeIn 0.5s ease forwards;
}

@keyframes staggerFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.streak-visual-bar-bg {
  width: 100px;
  height: 6px;
  background: #FFE4F0;
  border-radius: 4px;
  overflow: hidden;
}

.streak-visual-bar-fill {
  height: 100%;
  background: var(--magenta);
  border-radius: 4px;
  transition: width 1s ease;
}

.streak-visual-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: var(--fw-medium);
}

.mission-card {
  background: var(--bg-white);
  border-radius: 50%;
  padding: 32px;
  border: 1px solid var(--violet-light);
  box-shadow: 0 10px 30px -10px rgba(108, 43, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: visible;
}

.mission-header {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: var(--fw-bold);
  font-size: 1.2rem;
  color: var(--violet-dark);
}

.mission-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mission-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.mission-progress-bar-bg {
  flex: 1;
  height: 8px;
  background: var(--border-subtle);
  border-radius: 4px;
  overflow: hidden;
}

.mission-progress-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 4px;
  transition: width 1s ease;
}

.mission-progress-text {
  font-size: 0.85rem;
  font-weight: var(--fw-bold);
  color: var(--text-secondary);
}

.area-heat-bar {
  background: linear-gradient(90deg,
      var(--area-color) 0%,
      color-mix(in srgb, var(--area-color), white 30%) 100%);
  border-radius: 4px;
  height: 8px;
  transition: width 1s ease;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-header {
    flex-direction: column;
  }
}

@media (max-width: 900px) {
  .dashboard-hero-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .main-content {
    padding: 24px;
  }

  .mission-content {
    flex-direction: column;
    text-align: center;
  }

  .coach-mascot-img {
    height: 64px;
  }

  .coach-bubble::before {
    display: none;
  }
}


/* Ã¢â€â‚¬Ã¢â€â‚¬ Hub & Module Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬ */

/* ══ Hub & Module ══════════════════════════════════════════════ */

/* ── Compact Topbar (Duolingo-style) ── */
.hub-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-lg);
  padding: 16px 24px;
  background: var(--bg-white);
  border-bottom: 2px solid var(--hub-color, var(--violet));
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-xl);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.hub-topbar-left {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

.hub-topbar-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-primary);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s var(--ease);
  flex-shrink: 0;
}

.hub-topbar-back:hover {
  background: var(--hub-color, var(--violet));
  color: #fff;
  transform: scale(1.08);
}

.hub-topbar-title {
  font-size: 1.3rem;
  font-weight: var(--fw-extra);
  color: var(--hub-color, var(--violet));
  line-height: 1.15;
  letter-spacing: -0.3px;
  margin: 0;
}

.hub-topbar-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.3;
  margin: 0;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-topbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
}

.hub-topbar-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hub-topbar-pct {
  font-size: 0.85rem;
  font-weight: var(--fw-bold);
  color: var(--hub-color, var(--violet));
  min-width: 32px;
  text-align: right;
}

.hub-topbar-progress-track {
  width: 100px;
  height: 10px;
  background: var(--bg-secondary);
  border-radius: var(--r-full);
  overflow: hidden;
}

.hub-topbar-progress-fill {
  height: 100%;
  background: var(--hub-color, var(--violet));
  border-radius: var(--r-full);
  transition: width 0.6s var(--ease);
}

.hub-topbar-icon {
  font-size: 28px;
  color: var(--hub-color, var(--violet));
  opacity: 0.7;
}

/* ── Skeleton Loading System ── */
@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.skeleton-text {
  color: transparent !important;
  background: linear-gradient(90deg, #e8e8ee 25%, #f4f4f8 37%, #e8e8ee 63%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease infinite;
  border-radius: 6px;
  pointer-events: none;
  user-select: none;
}

.skeleton-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 32px 0;
}

.skeleton-node {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(90deg, #e8e8ee 25%, #f4f4f8 37%, #e8e8ee 63%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease infinite;
  position: relative;
  transition: margin 0.3s ease;
}

.skeleton-connector {
  width: 3px;
  height: 32px;
  background: linear-gradient(90deg, #e0e0e6 25%, #ececf0 37%, #e0e0e6 63%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease infinite;
  border-radius: 2px;
}

/* ── Hub Body Layout ── */
.hub-body {
  display: flex;
  gap: var(--sp-2xl);
  flex-wrap: wrap;
}

.hub-modules-col {
  flex: 2;
  min-width: 300px;
}

.hub-sidebar-col {
  flex: 1;
  min-width: 280px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
  position: sticky;
  top: 88px;
  align-self: flex-start;
}

/* ── Skora Super Upsell Card (Duolingo Style) ── */
.hub-card-super {
  background: var(--bg-white);
  border: 2px solid var(--border);
  border-radius: var(--r-xl);
  padding: 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 4px 0 var(--border);
  overflow: hidden;
}

.hub-card-super-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.hub-card-super-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hub-super-logo-badge {
  height: 24px;
  width: auto;
  display: block;
  margin-bottom: 12px;
}

.hub-card-super-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.2;
}

.hub-card-super-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

.hub-super-illustration {
  width: 75px;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.08));
  margin-top: -10px;
  margin-right: -5px;
}

.btn-super-cta {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px 20px;
  background: #6C2BFF;
  /* Primary Skora color */
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: var(--r-lg);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.1s var(--ease), box-shadow 0.1s var(--ease);
  box-shadow: 0 4px 0 #4a1bb5;
}

.btn-super-cta:hover {
  background: #7940ff;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #4a1bb5;
}

.btn-super-cta:active {
  transform: translateY(2px);
  box-shadow: 0 0px 0 #4a1bb5;
}

/* ── Premium Referral Card Variant ── */
.hub-card-super--premium {
  border-color: #00C853;
  box-shadow: 0 4px 0 #00A044;
  background: linear-gradient(135deg, #f0fff4 0%, #e8fdf0 50%, #fff 100%);
}

.hub-card-super--premium .hub-card-super-title {
  color: #00A044;
}

.btn-super-cta--referral {
  background: linear-gradient(135deg, #00C853, #00B44A);
  box-shadow: 0 4px 0 #008537;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-super-cta--referral:hover {
  background: linear-gradient(135deg, #00E676, #00C853);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #008537;
}

.btn-super-cta--referral:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 #008537;
}

/* ── Compact Action Cards ── */
.hub-card-action {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: all 0.2s var(--ease);
}

.hub-card-action:hover {
  border-color: var(--hub-color, var(--violet));
  box-shadow: 0 4px 16px color-mix(in srgb, var(--hub-color, var(--violet)) 12%, transparent);
}

.hub-card-action-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--hub-color, var(--violet)) 12%, transparent);
  color: var(--hub-color, var(--violet));
}

.hub-card-action-icon--secondary {
  background: var(--bg-primary);
  color: var(--text-secondary);
}

.hub-card-action-icon .material-symbols-outlined {
  font-size: 22px;
}

.hub-card-action-body {
  flex: 1;
  min-width: 0;
}

.hub-card-action-title {
  font-size: 0.88rem;
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin: 0 0 2px;
}

.hub-card-action-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.3;
}

.hub-card-action-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid var(--border);
  background: var(--bg-white);
  color: var(--hub-color, var(--violet));
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s var(--ease);
}

.hub-card-action-btn .material-symbols-outlined {
  font-size: 18px;
}

.hub-card-action-btn:hover {
  background: var(--hub-color, var(--violet));
  border-color: var(--hub-color, var(--violet));
  color: #fff;
  transform: scale(1.1);
}



/* ════════════════════════════════════════════════════
   SKILL TREE — "El Camino del Zorro" (Duolingo 3D Style)
   ════════════════════════════════════════════════════ */

.skill-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 40px 56px 96px;
  position: relative;
  max-width: 560px;
  min-height: 960px;
  margin: 0 auto;
  isolation: isolate;

  /* Dynamic Area Colors */
  --tree-color: var(--hub-color, var(--violet));
  --tree-color-light: color-mix(in srgb, var(--tree-color) 50%, white);
  --tree-color-dark: color-mix(in srgb, var(--tree-color) 80%, black);
  --tree-color-shadow: color-mix(in srgb, var(--tree-color) 50%, black);
  --tree-color-alpha: color-mix(in srgb, var(--tree-color) 30%, transparent);
  --path-line: #E7EDF3;
  --path-line-strong: color-mix(in srgb, var(--tree-color) 24%, #E7EDF3);
  --lane-offset: 108px;
}

.skill-tree::before {
  content: '';
  position: absolute;
  top: 48px;
  bottom: 72px;
  left: 50%;
  width: 12px;
  transform: translateX(-50%);
  border-radius: 999px;
  background:
    linear-gradient(180deg,
      transparent 0,
      var(--path-line-strong) 9%,
      var(--path-line) 28%,
      var(--path-line) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 6px rgba(248, 250, 252, 0.9);
  z-index: -2;
}

.skill-tree::after {
  content: '';
  position: absolute;
  top: 44px;
  left: 50%;
  width: 190px;
  height: 190px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--tree-color-alpha) 0%, transparent 70%);
  filter: blur(12px);
  opacity: 0.7;
  pointer-events: none;
  z-index: -3;
}

/* ── Topic Label (section divider) ── */
.skill-topic-label {
  width: 100%;
  text-align: center;
  margin: 42px 0 28px;
  position: relative;
  z-index: 2;
}

.skill-topic-label span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  padding: 12px 22px;
  border-radius: 18px;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--tree-color-dark);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  border: 2px solid color-mix(in srgb, var(--tree-color) 16%, #E5E7EB);
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.06),
    0 2px 0 color-mix(in srgb, var(--tree-color) 10%, #E5E7EB);
}

/* Subject-specific SVG icon in topic label */
.skill-topic-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px;
  flex-shrink: 0;
}

.skill-topic-icon svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

/* ── Section Sub-divider (tema within a topic) ── */
.skill-section-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  position: relative;
  z-index: 2;
  padding: 0 24px;
}

.skill-section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg,
      transparent,
      color-mix(in srgb, var(--tree-color) 20%, #E5E7EB) 30%,
      color-mix(in srgb, var(--tree-color) 20%, #E5E7EB) 70%,
      transparent);
}

.skill-section-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-white, #fff);
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--tree-color-dark, #475569);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--tree-color) 12%, #E5E7EB);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.skill-section-label .material-symbols-outlined {
  font-size: 14px;
  color: var(--tree-color, var(--violet));
  opacity: 0.7;
}

/* ── Connector Line between nodes ── */
.skill-connector {
  width: 10px;
  height: 34px;
  border-radius: var(--r-full);
  background: var(--path-line);
  transition: background 0.4s var(--ease);
  flex-shrink: 0;
  position: relative;
  z-index: -1;
}

.skill-connector.is-done {
  background: linear-gradient(180deg, var(--tree-color-light), var(--tree-color));
  box-shadow: 0 0 16px var(--tree-color-alpha);
}

/* ── Skill Node (each module) ── */
.skill-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  cursor: pointer;
  z-index: 1;
  pointer-events: none;
}

.skill-node[data-path-lane="center"] {
  left: 0;
}

.skill-node[data-path-lane="right"] {
  left: var(--lane-offset);
}

.skill-node[data-path-lane="left"] {
  left: calc(var(--lane-offset) * -1);
}

.skill-node[data-path-lane="right"]::before,
.skill-node[data-path-lane="left"]::before {
  content: '';
  position: absolute;
  top: 50%;
  height: 10px;
  border-radius: 999px;
  background: var(--path-line);
  transform: translateY(-50%);
  z-index: -1;
}

.skill-node[data-path-lane="right"]::before {
  left: calc(50% - var(--lane-offset) + 8px);
  width: calc(var(--lane-offset) - 42px);
}

.skill-node[data-path-lane="left"]::before {
  left: calc(50% + 34px);
  width: calc(var(--lane-offset) - 42px);
}

.skill-node.is-active[data-path-lane="right"]::before,
.skill-node.is-active[data-path-lane="left"]::before,
.skill-node.is-completed[data-path-lane="right"]::before,
.skill-node.is-completed[data-path-lane="left"]::before {
  background: linear-gradient(90deg, var(--tree-color-light), var(--tree-color));
  box-shadow: 0 0 16px var(--tree-color-alpha);
}

/* Elevate node when popover is open so it renders above siblings */
.skill-node.is-popover-open {
  z-index: 50;
}

/* Entrance animation */
.skill-node.skill-node-enter {
  animation: skillNodeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes skillNodeIn {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Zigzag Pattern (Duolingo S-curve) ── */
/* Pattern: center(0) → right(1) → center(2) → left(3) → repeat */
.skill-node {
  align-self: center;
  width: 100%;
}

/* Connectors always stay centered */
.skill-connector {
  align-self: center;
}

.skill-node[data-zigzag="1"] {
  align-items: center;
}

.skill-node[data-zigzag="3"] {
  align-items: center;
}

/* ── The Circle (core 3D visual) ── */
.skill-node-circle {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
  position: relative;
  z-index: 2;
  transition:
    transform 180ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 180ms cubic-bezier(0.23, 1, 0.32, 1),
    filter 180ms ease;
  pointer-events: auto;
}

.skill-node-circle::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.85), transparent 68%);
  opacity: 0;
  transition: opacity 180ms ease;
  z-index: -1;
}

.skill-node.is-active .skill-node-circle::before,
.skill-node.is-completed .skill-node-circle::before {
  content: '';
  position: absolute;
  top: 14%;
  left: 22%;
  width: 28%;
  height: 16%;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  transform: rotate(-20deg);
  pointer-events: none;
}

.skill-node-circle .material-symbols-outlined {
  font-size: 32px;
  color: var(--text-secondary);
  transition: all 0.2s var(--ease);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* ── Completed State (green 3D) ── */
.skill-node.is-completed .skill-node-circle {
  background: #16A34A;
  box-shadow:
    inset 0 4px 6px rgba(255, 255, 255, 0.4),
    inset 0 -6px 8px rgba(0, 0, 0, 0.25),
    0 6px 0 #15803D,
    0 8px 16px rgba(22, 163, 74, 0.25);
}

.skill-node.is-completed .skill-node-circle .material-symbols-outlined {
  color: #fff;
  font-size: 34px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.skill-node.is-completed .skill-node-circle:hover {
  transform: translateY(-3px) scale(1.04);
}

.skill-node.is-completed .skill-node-circle:active {
  transform: scale(0.94) translateY(4px);
  box-shadow:
    inset 0 4px 6px rgba(255, 255, 255, 0.4),
    inset 0 -4px 6px rgba(0, 0, 0, 0.25),
    0 2px 0 #15803D,
    0 4px 8px rgba(22, 163, 74, 0.25);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

/* ── Active State (dynamic area 3D with ring) ── */
.skill-node.is-active .skill-node-circle {
  background: var(--tree-color);
  box-shadow:
    inset 0 4px 6px rgba(255, 255, 255, 0.4),
    inset 0 -6px 8px rgba(0, 0, 0, 0.25),
    0 6px 0 var(--tree-color-shadow),
    0 10px 20px var(--tree-color-alpha);
  animation: breatheGlow 3s ease-in-out infinite;
}

.skill-node.is-active .skill-node-circle::after {
  opacity: 1;
}

.skill-node.is-active .skill-node-circle .material-symbols-outlined {
  color: #fff;
  font-size: 36px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.skill-node.is-active .skill-node-circle:hover {
  transform: translateY(-3px) scale(1.05);
}

.skill-node.is-active .skill-node-circle:active {
  transform: scale(0.94) translateY(4px);
  box-shadow:
    inset 0 4px 6px rgba(255, 255, 255, 0.4),
    inset 0 -4px 6px rgba(0, 0, 0, 0.25),
    0 2px 0 var(--tree-color-shadow),
    0 4px 8px var(--tree-color-alpha);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

@keyframes breatheGlow {

  0%,
  100% {
    box-shadow:
      inset 0 4px 6px rgba(255, 255, 255, 0.4),
      inset 0 -6px 8px rgba(0, 0, 0, 0.25),
      0 6px 0 var(--tree-color-shadow),
      0 0 12px var(--tree-color-alpha);
  }

  50% {
    box-shadow:
      inset 0 4px 6px rgba(255, 255, 255, 0.4),
      inset 0 -6px 8px rgba(0, 0, 0, 0.25),
      0 6px 0 var(--tree-color-shadow),
      0 0 24px var(--tree-color);
  }
}

/* ── Locked State (dark gray 3D) ── */
.skill-node.is-locked .skill-node-circle {
  background: linear-gradient(180deg, #F8FAFC 0%, #EEF2F7 100%);
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 1px solid #E2E8F0;
  box-shadow:
    inset 0 5px 8px rgba(255, 255, 255, 0.9),
    0 5px 0 #D7DEE8,
    0 12px 28px rgba(148, 163, 184, 0.14);
  opacity: 0.74;
  cursor: not-allowed;
}

.skill-node.is-locked .skill-node-circle:hover,
.skill-node.is-locked .skill-node-circle:active {
  transform: none !important;
}

.skill-node.is-locked .skill-node-circle .material-symbols-outlined {
  font-size: 26px;
  color: #9AA9B7;
}

.skill-node.is-locked .skill-node-info {
  opacity: 0.5;
}

/* ── Premium Locked State (golden 3D) ── */
.skill-node.is-premium-locked .skill-node-circle {
  background: linear-gradient(180deg, #FBBF24 0%, #F59E0B 50%, #D97706 100%);
  box-shadow:
    0 10px 20px rgba(245, 158, 11, 0.2),
    inset 0 -6px 12px rgba(0, 0, 0, 0.1),
    inset 0 6px 12px rgba(255, 255, 255, 0.35);
}

.skill-node.is-premium-locked .skill-node-circle .material-symbols-outlined {
  color: #fff;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.2));
}

/* ── Quiz Node — Terminal quiz node with amber/gold styling ── */
.skill-node--quiz {
  margin-top: -2px;
}

.skill-node-circle--quiz {
  width: 68px;
  height: 68px;
  border-radius: 50%;
}

/* Quiz circle — amber/gold gradient */
.skill-node--quiz .skill-node-circle--quiz {
  background: linear-gradient(180deg, #FCD34D 0%, #F59E0B 50%, #D97706 100%);
  box-shadow:
    0 8px 18px rgba(245, 158, 11, 0.25),
    inset 0 -5px 10px rgba(0, 0, 0, 0.1),
    inset 0 5px 10px rgba(255, 255, 255, 0.35);
}

.skill-node--quiz .skill-node-circle--quiz .material-symbols-outlined {
  font-size: 28px;
  color: #fff;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

.skill-node--quiz .skill-node-circle--quiz:hover {
  transform: translateY(-2px);
  box-shadow:
    0 14px 30px rgba(245, 158, 11, 0.3),
    inset 0 -5px 10px rgba(0, 0, 0, 0.1),
    inset 0 5px 10px rgba(255, 255, 255, 0.35);
}

.skill-node--quiz .skill-node-circle--quiz:active {
  transform: translateY(3px);
  box-shadow:
    0 3px 6px rgba(0, 0, 0, 0.1),
    inset 0 -2px 5px rgba(0, 0, 0, 0.1),
    inset 0 2px 5px rgba(255, 255, 255, 0.25);
}

/* Quiz Active — spinning ring */
.skill-node--quiz.is-active .skill-node-circle--quiz::before {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #F59E0B;
  border-right-color: #F59E0B;
  animation: activeRingSpin 2s linear infinite;
  opacity: 0.85;
}

.skill-node--quiz.is-active .skill-node-circle--quiz::after {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, transparent 70%);
  animation: activeGlow 2.5s ease-in-out infinite;
  z-index: -1;
}

/* Quiz Completed — green takeover */
.skill-node--quiz.is-completed .skill-node-circle--quiz {
  background: linear-gradient(180deg, #4ADE80 0%, var(--green) 50%, #16A34A 100%);
  box-shadow:
    0 8px 18px rgba(34, 197, 94, 0.25),
    inset 0 -5px 10px rgba(0, 0, 0, 0.1),
    inset 0 5px 10px rgba(255, 255, 255, 0.35);
}

.skill-node--quiz.is-completed .skill-node-circle--quiz .material-symbols-outlined {
  font-size: 30px;
}

/* Quiz Locked — muted */
.skill-node--quiz.is-locked .skill-node-circle--quiz {
  background: #E5E7EB;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5), 0 4px 8px rgba(0, 0, 0, 0.05);
  cursor: not-allowed;
}

.skill-node--quiz.is-locked .skill-node-circle--quiz .material-symbols-outlined {
  font-size: 22px;
  color: #9E9790;
}

/* ── Examen Skora — Subject-themed quiz popover ── */
.skill-popover--quiz {
  background: linear-gradient(135deg, var(--hub-color, #6C2BFF) 0%, color-mix(in srgb, var(--hub-color, #6C2BFF), #000 18%) 100%) !important;
  box-shadow:
    0 4px 0 color-mix(in srgb, var(--hub-color, #6C2BFF), #000 35%),
    0 12px 32px color-mix(in srgb, var(--hub-color, #6C2BFF), transparent 70%) !important;
}

.skill-popover--quiz::before {
  background: var(--hub-color, #6C2BFF) !important;
}

.skill-popover--quiz,
.skill-popover--quiz .skill-popover-title,
.skill-popover--quiz .skill-popover-subtitle,
.skill-popover--quiz .skill-popover-status,
.skill-popover--quiz .skill-popover-meta,
.skill-popover--quiz .skill-popover-meta .material-symbols-outlined {
  color: #fff !important;
}

.skill-popover--quiz .skill-popover-status,
.skill-popover--quiz .skill-popover-meta {
  color: rgba(255, 255, 255, 0.84) !important;
}

.skill-popover-subtitle {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.82);
  opacity: 0.85;
  margin-top: -2px;
  margin-bottom: 4px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.skill-popover-btn--quiz {
  background: var(--bg-white);
  color: var(--hub-color, #6C2BFF);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--hub-color, #6C2BFF), #000 35%), 0 4px 12px rgba(0, 0, 0, 0.08);
  font-weight: 700;
  transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 160ms cubic-bezier(0.23, 1, 0.32, 1);
}

.skill-popover-btn--quiz:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--hub-color, #6C2BFF), #000 35%), 0 6px 16px rgba(0, 0, 0, 0.12);
}

.skill-popover-btn--quiz:active {
  transform: translateY(2px) scale(0.97);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--hub-color, #6C2BFF), #000 35%), 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* ── Examen Skora Node — Subject-color circle ── */
.skill-node--examen .skill-node-circle--quiz {
  background: linear-gradient(180deg,
      color-mix(in srgb, var(--hub-color, #6C2BFF), #fff 20%) 0%,
      var(--hub-color, #6C2BFF) 50%,
      color-mix(in srgb, var(--hub-color, #6C2BFF), #000 15%) 100%) !important;
  box-shadow:
    0 6px 0 color-mix(in srgb, var(--hub-color, #6C2BFF), #000 35%),
    0 8px 18px color-mix(in srgb, var(--hub-color, #6C2BFF), transparent 65%),
    inset 0 -5px 10px rgba(0, 0, 0, 0.1),
    inset 0 5px 10px rgba(255, 255, 255, 0.35) !important;
  transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 160ms cubic-bezier(0.23, 1, 0.32, 1);
}

.skill-node--examen .skill-node-circle--quiz:hover {
  transform: translateY(-2px) !important;
  box-shadow:
    0 10px 0 color-mix(in srgb, var(--hub-color, #6C2BFF), #000 35%),
    0 14px 30px color-mix(in srgb, var(--hub-color, #6C2BFF), transparent 55%),
    inset 0 -5px 10px rgba(0, 0, 0, 0.1),
    inset 0 5px 10px rgba(255, 255, 255, 0.35) !important;
}

.skill-node--examen .skill-node-circle--quiz:active {
  transform: translateY(3px) scale(0.97) !important;
  box-shadow:
    0 2px 0 color-mix(in srgb, var(--hub-color, #6C2BFF), #000 35%),
    0 3px 6px rgba(0, 0, 0, 0.1),
    inset 0 -2px 5px rgba(0, 0, 0, 0.1),
    inset 0 2px 5px rgba(255, 255, 255, 0.25) !important;
}

/* Examen Skora Active — subject-color spinning ring */
.skill-node--examen.is-active .skill-node-circle--quiz::before {
  border-top-color: var(--hub-color, #6C2BFF) !important;
  border-right-color: var(--hub-color, #6C2BFF) !important;
}

.skill-node--examen.is-active .skill-node-circle--quiz::after {
  background: radial-gradient(circle, color-mix(in srgb, var(--hub-color, #6C2BFF), transparent 65%) 0%, transparent 70%) !important;
}

/* Examen Skora Completed — green takeover stays */
.skill-node--examen.is-completed .skill-node-circle--quiz {
  background: linear-gradient(180deg, #4ADE80 0%, var(--green) 50%, #16A34A 100%) !important;
  box-shadow:
    0 8px 18px rgba(34, 197, 94, 0.25),
    inset 0 -5px 10px rgba(0, 0, 0, 0.1),
    inset 0 5px 10px rgba(255, 255, 255, 0.35) !important;
}

/* ── Node Info — HIDDEN by default, shown in popover ── */
.skill-node-info {
  display: none;
}

/* ── Floating "EMPEZAR" bubble (Duolingo-style, white card ABOVE node) ── */
.skill-start-label {
  position: relative;
  margin-bottom: 10px;
  padding: 9px 22px;
  background: var(--bg-white);
  border: 2px solid color-mix(in srgb, var(--tree-color) 12%, #E5E7EB);
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--tree-color);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.08),
    0 3px 0 color-mix(in srgb, var(--tree-color) 12%, #E5E7EB);
  animation: startLabelBounce 2s ease-in-out infinite;
  cursor: pointer;
  user-select: none;
  z-index: 3;
}

/* Speech bubble pointer (triangle pointing DOWN toward the node) */
.skill-start-label::before {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: var(--bg-white);
  border-right: 2px solid color-mix(in srgb, var(--tree-color) 12%, #E5E7EB);
  border-bottom: 2px solid color-mix(in srgb, var(--tree-color) 12%, #E5E7EB);
  box-shadow: 2px 2px 2px rgba(15, 23, 42, 0.03);
}

@keyframes startLabelBounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}

/* ── Skill Popover Card (Subject-colored, Duolingo-style) ── */
.skill-popover {
  position: absolute;
  top: var(--skill-popover-top, calc(100% + 14px));
  left: var(--skill-popover-left, 50%);
  right: auto;
  transform: translate(var(--skill-popover-translate-x, -50%), 8px);
  width: 280px;
  z-index: 100;
  padding: 20px;
  border-radius: 18px;
  background: var(--tree-color);
  border: none;
  color: #fff;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Arrow — matches subject color */
.skill-popover::before {
  content: '';
  position: absolute;
  top: -7px;
  left: var(--skill-popover-arrow-x, 50%);
  transform: translateX(-50%) rotate(45deg);
  width: 14px;
  height: 14px;
  background: var(--tree-color);
  z-index: -1;
}

/* Open state */
.skill-node.is-popover-open .skill-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translate(var(--skill-popover-translate-x, -50%), 0);
}

/* Popover inner elements — all white text */
.skill-popover-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 4px 0;
  line-height: 1.3;
  font-style: italic;
}

.skill-popover-status {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 10px;
}

/* Override specific status colors — they're all on colored bg now */
.skill-node.is-completed .skill-popover-status,
.skill-node.is-active .skill-popover-status {
  color: rgba(255, 255, 255, 0.85);
}

.skill-popover-meta {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.skill-popover-meta .material-symbols-outlined {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.75);
}

/* CTA Button — white with subject-colored text */
.skill-popover-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 0;
  border-radius: 14px;
  border: none;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
  text-decoration: none;
  color: var(--tree-color);
  background: var(--bg-white);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.15s ease;
}

.skill-popover-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.12);
}

.skill-popover-btn:active {
  transform: translateY(2px);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.06);
}

.skill-popover-btn--locked {
  background: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.7);
  box-shadow: none;
  cursor: not-allowed;
}

.skill-popover-btn--premium {
  background: var(--bg-white);
  color: #D97706;
  box-shadow: 0 3px 0 #B45309, 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ── Locked Popover (Duolingo "CERRADA" style) ── */
.skill-popover--locked {
  background: linear-gradient(135deg, #8B8680 0%, #6E6962 100%) !important;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.12) !important;
}

.skill-popover--locked::before {
  background: #8B8680 !important;
}

.skill-popover--locked .skill-popover-title {
  color: rgba(255, 255, 255, 0.75);
}

.skill-popover--locked .skill-popover-status {
  color: rgba(255, 255, 255, 0.55);
}

.skill-popover--locked .skill-popover-meta {
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
  font-size: 0.75rem;
}

.skill-popover--locked .skill-popover-btn--locked {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.5);
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}

/* Edge clamping — keep popover inside viewport */
.skill-node[data-zigzag="1"] .skill-popover:not([data-placement]) {
  left: auto;
  right: 0;
  transform: translateY(8px);
}

.skill-node[data-zigzag="1"].is-popover-open .skill-popover:not([data-placement]) {
  transform: translateY(0);
}

.skill-node[data-zigzag="1"] .skill-popover:not([data-placement])::before {
  left: auto;
  right: 30px;
  transform: rotate(45deg);
}

.skill-node[data-zigzag="3"] .skill-popover:not([data-placement]) {
  left: 0;
  transform: translateY(8px);
}

.skill-node[data-zigzag="3"].is-popover-open .skill-popover:not([data-placement]) {
  transform: translateY(0);
}

.skill-node[data-zigzag="3"] .skill-popover:not([data-placement])::before {
  left: 30px;
  transform: rotate(45deg);
}

.skill-node .skill-popover[data-placement]::before {
  inset: auto;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
}

.skill-node .skill-popover[data-placement="bottom"]::before {
  top: -7px;
  left: var(--skill-popover-arrow-x, 50%);
  transform: translateX(-50%) rotate(45deg);
}

.skill-node .skill-popover[data-placement="top"]::before {
  bottom: -7px;
  left: var(--skill-popover-arrow-x, 50%);
  transform: translateX(-50%) rotate(45deg);
}

.skill-node .skill-popover[data-placement="right"]::before {
  left: -7px;
  top: var(--skill-popover-arrow-y, 50%);
  transform: translateY(-50%) rotate(45deg);
}

.skill-node .skill-popover[data-placement="left"]::before {
  right: -7px;
  top: var(--skill-popover-arrow-y, 50%);
  transform: translateY(-50%) rotate(45deg);
}

/* ── Skip Button (on locked nodes) ── */
.skill-skip-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-white);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.25s var(--ease);
  z-index: 3;
}

.skill-skip-btn .material-symbols-outlined {
  font-size: 16px;
}

.skill-node.is-locked:hover .skill-skip-btn {
  opacity: 1;
}

.skill-skip-btn:hover {
  background: var(--tree-color);
  border-color: var(--tree-color-dark);
  color: #fff;
  transform: scale(1.15);
  box-shadow: 0 4px 12px var(--tree-color-alpha);
}

/* Fox mascot removed — replaced by EMPEZAR label + popover */

/* ── Legacy hub module classes (kept for backward compat if needed) ── */
.hub-topic-group {
  margin-bottom: var(--sp-2xl);
}

.hub-topic-title {
  margin-bottom: var(--sp-md);
  font-size: 1.1rem;
  font-weight: var(--fw-bold);
  color: var(--text-primary);
}

.hub-topic-modules {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

/* --- Hub Utility Cards (Right Column) --- */
.hub-utility-card {
  padding: var(--sp-xl);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.hub-utility-card--accent {
  border-color: rgba(108, 43, 255, 0.15);
}

.hub-utility-card--dark {
  background: #1a1a2e;
  border-color: transparent;
  color: var(--text-inverse);
}

.hub-utility-card--dark h3,
.hub-utility-card--dark p {
  color: rgba(255, 255, 255, 0.85);
}

.hub-utility-icon {
  display: inline-flex;
  padding: 8px;
  background: var(--violet-light);
  border-radius: var(--r-md);
  color: var(--violet);
  margin-bottom: var(--sp-md);
}

.hub-utility-card--dark .hub-utility-icon {
  background: rgba(108, 43, 255, 0.2);
}

.hub-utility-title {
  font-size: 1.15rem;
  font-weight: var(--fw-bold);
  margin-bottom: var(--sp-xs);
}

.hub-utility-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--sp-lg);
  line-height: 1.5;
}

.hub-utility-card--dark .hub-utility-desc {
  color: rgba(255, 255, 255, 0.6);
}

.hub-premium-badge {
  font-size: 0.65rem;
  font-weight: var(--fw-bold);
  background: var(--magenta);
  color: white;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hub-unlock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--violet-light);
  border: 1px solid rgba(108, 43, 255, 0.15);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.hub-unlock-row:hover {
  background: rgba(108, 43, 255, 0.15);
}

.hub-unlock-label {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-size: 0.85rem;
  font-weight: var(--fw-bold);
  color: var(--violet);
}

/* --- Sidebar User Panel (replaces inline styles) --- */
.sidebar-user-panel {
  padding: var(--sp-lg);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--violet-light);
  color: var(--violet);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-bold);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
}

.sidebar-user-name {
  font-size: 0.85rem;
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.sidebar-user-plan {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* --- Hub Responsive --- */
@media (max-width: 900px) {
  .hub-hero {
    flex-direction: column;
    text-align: center;
  }

  .hub-hero-content {
    padding-right: 0;
  }

  .hub-hero-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hub-progress-box {
    margin: 0 auto;
  }

  .hub-next-objective {
    margin: 0 auto var(--sp-lg);
    max-width: 100%;
  }

  .hub-body {
    flex-direction: column;
  }

  .hub-hero-visual {
    display: none;
  }

  /* Skill Tree responsive */
  .skill-tree {
    max-width: 100%;
    padding: 32px 24px 64px;
    --lane-offset: 78px;
  }

  .skill-node-circle {
    width: 72px;
    height: 72px;
  }

  .skill-node-circle .material-symbols-outlined {
    font-size: 26px;
  }

  .skill-node.is-active .skill-node-circle .material-symbols-outlined {
    font-size: 30px;
  }

  .skill-node[data-path-lane="right"]::before,
  .skill-node[data-path-lane="left"]::before {
    width: 40px;
  }

  .skill-fox-container {
    display: none;
  }

  .skill-connector {
    height: 24px;
  }

  .skill-topic-label span {
    padding: 8px 18px;
    font-size: 0.7rem;
  }
}

/* --- Legacy classes (kept for other views) --- */
.hub-header {
  padding: var(--sp-2xl);
  border-radius: var(--r-lg);
  color: var(--text-inverse);
  margin-bottom: var(--sp-xl);
  position: relative;
  overflow: hidden;
}

.hub-header h1 {
  color: var(--text-inverse);
  margin-bottom: var(--sp-xs);
}

.hub-header p {
  color: rgba(255, 255, 255, 0.8);
}

.module-grid {
  display: grid;
  gap: var(--sp-md);
}

.module-card {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  background: var(--bg-white);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  text-decoration: none;
  color: var(--text-primary);
}

.module-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--violet);
}

.area-card {
  padding: var(--sp-lg);
  background: var(--bg-white);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration) var(--ease);
  text-decoration: none;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
}

.area-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--violet);
}

.area-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-md);
}

/* Ã¢â€â‚¬Ã¢â€â‚¬ Lesson Content Styles (rendered from content_html) Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬ */
.lesson-viewer {
  max-width: 720px;
  margin: 0 auto;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: normal;
  width: 100%;
  box-sizing: border-box;
}

.lesson-viewer h1,
.lesson-viewer h2 {
  margin-bottom: var(--sp-md);
  font-weight: var(--fw-bold);
  font-size: 1.8rem;
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: normal;
}

.lesson-viewer h3 {
  margin-top: var(--sp-xl);
  margin-bottom: var(--sp-sm);
  font-size: 1.3rem;
}

.lesson-viewer p {
  margin-bottom: var(--sp-md);
  line-height: 1.8;
  color: var(--text-primary);
  font-size: 1.05rem;
}

.lesson-viewer ul {
  padding-left: var(--sp-lg);
  margin-bottom: var(--sp-md);
}

.lesson-viewer li {
  margin-bottom: var(--sp-sm);
  color: var(--text-primary);
  line-height: 1.6;
}

/* ── Theory Figure Images (authored in Studio) ── */
.lesson-viewer figure[data-width] {
  margin: var(--sp-lg) 0;
  padding: 0;
}

.lesson-viewer figure[data-width] img {
  width: 100%;
  display: block;
  border-radius: var(--r-md, 8px);
}

.lesson-viewer figure[data-width="25"] {
  max-width: 25%;
}

.lesson-viewer figure[data-width="50"] {
  max-width: 50%;
}

.lesson-viewer figure[data-width="75"] {
  max-width: 75%;
}

.lesson-viewer figure[data-width="100"] {
  max-width: 100%;
}

.lesson-viewer figure[data-align="left"] {
  margin-right: auto;
}

.lesson-viewer figure[data-align="center"] {
  margin-left: auto;
  margin-right: auto;
}

.lesson-viewer figure[data-align="right"] {
  margin-left: auto;
}

/* ── Theory Math Equations (authored in Studio) ── */
.lesson-viewer .math-inline {
  display: inline;
  vertical-align: baseline;
}

.lesson-viewer .math-block {
  display: block;
  text-align: center;
  padding: var(--sp-lg) var(--sp-xl);
  margin: var(--sp-lg) 0;
  background: #f8f9fa;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--r-md, 8px);
  overflow-x: auto;
}

/* ── Theory Blockquote ── */
.lesson-viewer blockquote {
  border-left: 3px solid var(--violet, #6C2BFF);
  padding: var(--sp-sm) var(--sp-md);
  margin: var(--sp-md) 0;
  background: rgba(108, 43, 255, 0.03);
  border-radius: 0 var(--r-md, 8px) var(--r-md, 8px) 0;
  color: var(--text-secondary);
  font-style: italic;
}

.lesson-viewer hr {
  border: none;
  height: 2px;
  background: var(--border, #e5e7eb);
  margin: var(--sp-xl) 0;
  border-radius: 1px;
}

.lesson-viewer strong {
  font-weight: var(--fw-bold, 700);
}

/* Module Sidebar Timeline — Gamified V2 */
.module-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 4px;
  position: relative;
}


.module-section-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: var(--fw-extra);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-top: 12px;
  margin-bottom: 4px;
  padding-left: 40px;
}

.module-section-label:first-child {
  margin-top: 0;
}

.module-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
  text-decoration: none;
  color: var(--text-secondary);
  padding: 10px 10px;
  border-radius: 14px;
  border: 1.5px solid transparent;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.module-nav-item:hover {
  background: var(--module-color-light, rgba(108, 43, 255, 0.05));
  border-color: color-mix(in srgb, var(--module-color, var(--violet)) 10%, transparent);
  transform: translateX(3px);
}

.module-nav-item.active {
  background: var(--module-color-light, rgba(108, 43, 255, 0.08));
  border-color: color-mix(in srgb, var(--module-color, var(--violet)) 20%, transparent);
  color: var(--module-color, var(--violet));
  box-shadow: 0 2px 8px color-mix(in srgb, var(--module-color, var(--violet)) 8%, transparent);
}

.module-nav-item.locked {
  opacity: 0.45;
  cursor: default !important;
}

.module-nav-item.locked:hover {
  background: transparent;
  border-color: transparent;
  transform: none;
}

/* ── Mini-3D Node Indicators ── */
.module-nav-indicator {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.06),
    inset 0 -1px 2px rgba(0, 0, 0, 0.04);
}

.module-nav-item.active .module-nav-indicator {
  border-color: var(--module-color, var(--violet));
  background: var(--module-color, var(--violet));
  box-shadow:
    0 0 0 4px var(--module-color-light, rgba(108, 43, 255, 0.15)),
    0 3px 10px var(--module-color-glow, rgba(108, 43, 255, 0.3)),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  animation: nodeGlow 2s ease-in-out infinite;
}

.module-nav-item.completed .module-nav-indicator {
  border-color: #10B981;
  background: linear-gradient(135deg, #10B981, #059669);
  box-shadow:
    0 2px 8px rgba(16, 185, 129, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.module-nav-indicator--quiz {
  background: var(--module-color, var(--violet)) !important;
  border-color: var(--module-color, var(--violet)) !important;
  box-shadow:
    0 2px 6px var(--module-color-glow, rgba(108, 43, 255, 0.2)),
    inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

@keyframes nodeGlow {

  0%,
  100% {
    box-shadow:
      0 0 0 4px var(--module-color-light),
      0 3px 10px var(--module-color-glow),
      inset 0 1px 0 rgba(255, 255, 255, 0.25);
  }

  50% {
    box-shadow:
      0 0 0 6px var(--module-color-light),
      0 4px 14px var(--module-color-glow),
      inset 0 1px 0 rgba(255, 255, 255, 0.25);
  }
}

/* Nav Item Text */
.module-nav-item-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.module-nav-item-title {
  font-size: 0.85rem;
  font-weight: var(--fw-semi);
  line-height: 1.3;
}

.module-nav-item-status {
  font-size: 0.65rem;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--module-color, var(--violet));
}

.module-nav-item-status.completed {
  color: #10B981;
}

/* ── Dashboard Welcome ── */
.dashboard-welcome {
  margin-bottom: var(--sp-xl);
}

.dashboard-welcome p {
  margin-top: var(--sp-xs);
}

.progress-summary {
  padding: var(--sp-md) 0;
}

/* ══════════════════════════════════════════════════════════════
   Module View Layout — "Lesson Flow" Redesign V2
   ══════════════════════════════════════════════════════════════ */

/* ── Module Splash Screen ── */
.module-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #6C2BFF;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.module-splash.splash-exit {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

.module-splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.module-splash-logo-img {
  width: 220px;
  height: auto;
  position: relative;
  z-index: 1;
  animation: splashPulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
}

.module-splash-text {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  letter-spacing: 0.5px;
  margin: 0;
}

.module-splash-bar {
  width: 180px;
  height: 3px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
  margin-top: 4px;
}

.module-splash-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.5), #fff, rgba(255, 255, 255, 0.5));
  animation: splashBar 1.8s ease-in-out infinite;
}

@keyframes splashPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

@keyframes splashBar {
  0% {
    width: 0%;
    transform: translateX(0);
  }

  50% {
    width: 70%;
  }

  100% {
    width: 100%;
    transform: translateX(0);
  }
}

.module-layout {
  --module-color: #6C2BFF;
  --module-color-light: rgba(108, 43, 255, 0.08);
  --module-color-medium: rgba(108, 43, 255, 0.15);
  --module-color-glow: rgba(108, 43, 255, 0.25);
  background: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
  /* prevent any horizontal scroll escape */
  box-sizing: border-box;
  width: 100%;
  max-width: 100vw;
}

/* ── Immersive Subject-Colored Header ── */
.module-header {
  background: var(--bg-white);
  padding: 14px 32px 0;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow:
    0 1px 0 var(--border),
    0 4px 20px rgba(0, 0, 0, 0.04);
  border-bottom: 3px solid color-mix(in srgb, var(--module-color, var(--violet)) 20%, transparent);
}

.module-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-lg);
  padding-bottom: 12px;
}

.module-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.module-back-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--module-color-light);
  color: var(--module-color, var(--violet));
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.module-back-btn:hover {
  background: var(--module-color-medium);
  border-color: color-mix(in srgb, var(--module-color, var(--violet)) 30%, transparent);
  transform: translateX(-3px) scale(1.04);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--module-color, var(--violet)) 15%, transparent);
}

.module-back-btn:active {
  transform: translateX(-1px) scale(0.96);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.module-header-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.module-header-title {
  font-size: 1.1rem;
  font-weight: var(--fw-bold);
  margin: 0;
  color: var(--text-primary);
  line-height: 1.3;
}

.module-header-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

.module-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* XP Badge */
.module-xp-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, #FFF8E1, #FFECB3);
  color: #F57F17;
  font-size: 0.78rem;
  font-weight: var(--fw-extra);
  border: 2px solid rgba(245, 127, 23, 0.18);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow:
    0 2px 8px rgba(245, 127, 23, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.module-xp-badge:hover {
  transform: scale(1.06);
  box-shadow:
    0 4px 14px rgba(245, 127, 23, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.module-xp-badge.xp-pulse {
  animation: xpBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes xpBounce {

  0%,
  100% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.2);
  }

  70% {
    transform: scale(0.95);
  }
}

/* ── Slide Timer Badge ── */
.slide-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
  color: #E65100;
  font-size: 0.78rem;
  font-weight: var(--fw-extra);
  font-variant-numeric: tabular-nums;
  border: 1px solid rgba(230, 81, 0, 0.2);
  transition: all 0.4s ease;
  animation: timerAppear 0.4s ease;
}

.slide-timer-badge.timer-done {
  background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
  color: #2E7D32;
  border-color: rgba(46, 125, 50, 0.2);
}

.slide-timer-badge.timer-fade {
  opacity: 0;
  transform: translateY(-8px);
}

@keyframes timerAppear {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Timer-locked Next button */
.module-nav-btn.timer-locked {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

/* Progress Tag */
.module-progress-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: var(--r-full);
  background: var(--module-color-light);
  color: var(--module-color, var(--violet));
  font-size: 0.78rem;
  font-weight: var(--fw-bold);
}

/* ── Segmented Progress Bar ── */
.module-progress-bar {
  display: flex;
  gap: 4px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  height: 6px;
}

.module-progress-segment {
  flex: 1;
  height: 100%;
  border-radius: 4px;
  background: color-mix(in srgb, var(--module-color, var(--violet)) 10%, var(--border));
  overflow: hidden;
  transition: background 0.3s ease;
}

.module-progress-segment .module-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 4px;
  background: var(--module-color, var(--violet));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.module-progress-segment.completed .module-progress-fill {
  width: 100%;
}

.module-progress-segment.current .module-progress-fill {
  width: 50%;
  background: linear-gradient(90deg, var(--module-color, var(--violet)), color-mix(in srgb, var(--module-color, var(--violet)) 70%, #fff));
  box-shadow: 0 0 10px var(--module-color-glow);
  animation: progressPulse 1.5s ease-in-out infinite;
}

@keyframes progressPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.75;
  }
}

/* ── Main Layout ── */
.module-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  align-items: flex-start;
  box-sizing: border-box;
  width: 100%;
}

.module-aside {
  width: 280px;
  flex-shrink: 0;
}

.module-aside-sticky {
  position: sticky;
  top: 100px;
}

.module-aside-heading {
  font-size: 0.75rem;
  font-weight: var(--fw-extra);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--module-color, var(--text-secondary));
  margin-bottom: 16px;
  display: flex;
  align-items: center;
}

/* ── Reward Card ── */
.module-reward-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #FFF8E1, #FFECB3);
  border: 2px solid rgba(245, 127, 23, 0.15);
  border-radius: 16px;
  box-shadow:
    0 2px 8px rgba(245, 127, 23, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.module-reward-card:hover {
  transform: translateY(-1px);
  box-shadow:
    0 4px 14px rgba(245, 127, 23, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.module-reward-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(245, 127, 23, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #F57F17;
  box-shadow: 0 2px 6px rgba(245, 127, 23, 0.1);
}

.module-reward-icon .material-symbols-outlined {
  font-size: 22px;
}

.module-reward-info {
  display: flex;
  flex-direction: column;
}

.module-reward-label {
  font-size: 0.7rem;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #E65100;
}

.module-reward-value {
  font-size: 0.85rem;
  font-weight: var(--fw-extra);
  color: #F57F17;
}

/* ── Tip Card (Subject-Colored) ── */
.module-tip-card {
  margin-top: 16px;
  padding: 16px 18px;
  background: var(--module-color-light);
  border: 2px solid var(--module-color-medium);
  border-radius: 16px;
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.module-tip-card:hover {
  transform: translateY(-1px);
  box-shadow:
    0 4px 12px color-mix(in srgb, var(--module-color, var(--violet)) 10%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.module-tip-label {
  color: var(--module-color, var(--violet));
  display: block;
  margin-bottom: 6px;
  font-weight: var(--fw-bold);
  font-size: 0.75rem;
  letter-spacing: 0.3px;
}

/* ── Content Column ── */
.module-content-col {
  flex: 1;
  min-width: 0;
  /* allow flex item to shrink below content size */
  max-width: 100%;
  box-sizing: border-box;
  width: 100%;
}

/* ── Content Card with Accent Bar ── */
.module-content-card {
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 36px 44px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(0, 0, 0, 0.03),
    0 12px 40px rgba(0, 0, 0, 0.02);
  margin-bottom: 20px;
  border-top: 4px solid var(--module-color, var(--violet));
  position: relative;
  box-sizing: border-box;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  transition: box-shadow 0.3s ease;
}

.module-content-card:hover {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 6px 20px rgba(0, 0, 0, 0.04),
    0 16px 48px rgba(0, 0, 0, 0.03);
}

/* Lesson Badge */
.module-lesson-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: var(--r-full);
  background: var(--module-color-light);
  color: var(--module-color, var(--violet));
  font-size: 0.72rem;
  font-weight: var(--fw-bold);
  margin-bottom: 20px;
  letter-spacing: 0.3px;
  border: 1.5px solid color-mix(in srgb, var(--module-color, var(--violet)) 15%, transparent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* ══════════════════════════════════════════════════════════════
   Navigation Footer — Claymorphism-inspired, polished EdTech
   ══════════════════════════════════════════════════════════════ */
.module-nav-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0 12px;
  gap: 12px;
}

/* ── Base Navigation Buttons ── */
.module-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  padding: 13px 24px;
  font-size: 0.88rem;
  font-weight: var(--fw-bold);
  letter-spacing: 0.2px;
  border-radius: 16px;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.module-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ── Previous Button (Outline / Ghost) ── */
.module-nav-btn.btn-outline {
  background: var(--bg-white);
  border-color: var(--border);
  color: var(--text-secondary);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.04),
    inset 0 -1px 2px rgba(0, 0, 0, 0.03);
}

.module-nav-btn.btn-outline:not(:disabled):hover {
  border-color: var(--module-color, var(--violet));
  color: var(--module-color, var(--violet));
  background: color-mix(in srgb, var(--module-color, var(--violet)) 4%, var(--bg-white));
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.06),
    inset 0 -1px 2px rgba(0, 0, 0, 0.03);
  transform: translateX(-3px);
}

.module-nav-btn.btn-outline:not(:disabled):active {
  transform: translateX(-1px) scale(0.98);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ── Next / Complete Button (Primary) ── */
.module-nav-btn--next {
  background: var(--module-color, var(--violet)) !important;
  border-color: color-mix(in srgb, var(--module-color, var(--violet)) 85%, #000) !important;
  color: #fff !important;
  padding: 13px 28px;
  box-shadow:
    0 4px 14px color-mix(in srgb, var(--module-color, var(--violet)) 35%, transparent),
    0 1px 3px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.module-nav-btn--next:hover {
  transform: translateX(4px) translateY(-1px);
  box-shadow:
    0 8px 24px color-mix(in srgb, var(--module-color, var(--violet)) 40%, transparent),
    0 2px 6px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.module-nav-btn--next:active {
  transform: translateX(2px) translateY(1px);
  box-shadow:
    0 2px 8px color-mix(in srgb, var(--module-color, var(--violet)) 25%, transparent),
    inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* ── Completion Variant — Celebration Style ── */
.module-nav-btn--complete {
  background: linear-gradient(135deg,
      var(--module-color, var(--violet)),
      color-mix(in srgb, var(--module-color, var(--violet)) 75%, #ff6b6b)) !important;
  border-color: color-mix(in srgb, var(--module-color, var(--violet)) 80%, #000) !important;
  padding: 14px 32px;
  font-size: 0.92rem;
  box-shadow:
    0 6px 20px color-mix(in srgb, var(--module-color, var(--violet)) 40%, transparent),
    0 2px 6px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: completeBtnGlow 2.5s ease-in-out infinite;
}

.module-nav-btn--complete:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 10px 32px color-mix(in srgb, var(--module-color, var(--violet)) 50%, transparent),
    0 4px 8px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.module-nav-btn--complete:active {
  transform: translateY(0) scale(0.98);
  animation: none;
}

@keyframes completeBtnGlow {

  0%,
  100% {
    box-shadow:
      0 6px 20px color-mix(in srgb, var(--module-color, var(--violet)) 35%, transparent),
      0 2px 6px rgba(0, 0, 0, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }

  50% {
    box-shadow:
      0 8px 28px color-mix(in srgb, var(--module-color, var(--violet)) 50%, transparent),
      0 2px 6px rgba(0, 0, 0, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
}

/* ── Completed Review Variant — Subtle success ── */
.module-nav-btn--completed {
  background: linear-gradient(135deg, #10B981, #059669) !important;
  border-color: #047857 !important;
  padding: 13px 28px;
  box-shadow:
    0 4px 14px rgba(16, 185, 129, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: none;
}

.module-nav-btn--completed:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 24px rgba(16, 185, 129, 0.35),
    0 2px 6px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* ── Quiz Pulse (legacy compat) ── */
.module-nav-btn--quiz {
  animation: quizPulse 2s ease-in-out infinite;
}

@keyframes quizPulse {

  0%,
  100% {
    box-shadow:
      0 4px 14px color-mix(in srgb, var(--module-color, var(--violet)) 35%, transparent),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }

  50% {
    box-shadow:
      0 8px 28px color-mix(in srgb, var(--module-color, var(--violet)) 50%, transparent),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
}

/* ── XP Badge inside Button ── */
.module-nav-xp {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.22);
  font-size: 0.65rem;
  font-weight: var(--fw-extra);
  margin-left: 8px;
  letter-spacing: 0.4px;
  backdrop-filter: blur(4px);
}

/* ── Optional Quiz Link ── */
.module-optional-quiz {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  margin-top: 4px;
  font-size: 0.84rem;
  font-weight: var(--fw-bold);
  color: var(--module-color, var(--violet));
  text-decoration: none;
  border-radius: 14px;
  border: 2px dashed color-mix(in srgb, var(--module-color, var(--violet)) 25%, transparent);
  background: color-mix(in srgb, var(--module-color, var(--violet)) 5%, transparent);
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.module-optional-quiz:hover {
  background: color-mix(in srgb, var(--module-color, var(--violet)) 10%, transparent);
  border-color: color-mix(in srgb, var(--module-color, var(--violet)) 45%, transparent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--module-color, var(--violet)) 12%, transparent);
}

.module-optional-quiz:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ── Content Transition Animations ── */
.lesson-fade-out {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.lesson-fade-in {
  animation: lessonSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes lessonSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .module-header {
    padding: 12px 16px 0;
  }

  .module-header-inner {
    gap: 10px;
  }

  .module-header-desc {
    display: none;
  }

  .module-xp-badge {
    display: none;
  }

  .module-main {
    flex-direction: column;
    padding: 16px 12px;
    gap: 16px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .module-aside {
    width: 100%;
    flex-shrink: 1;
    order: 2;
  }

  .module-content-col {
    order: 1;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .module-content-card {
    padding: 20px 16px;
    border-radius: 16px;
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .module-nav-footer {
    gap: 8px;
    padding: 16px 0 8px;
  }

  .module-nav-btn {
    padding: 12px 16px;
    font-size: 0.82rem;
    border-radius: 14px;
  }

  .module-nav-btn--complete,
  .module-nav-btn--completed {
    padding: 12px 20px;
  }

  .module-optional-quiz {
    padding: 10px 16px;
    font-size: 0.8rem;
    border-radius: 12px;
  }

  /* Header mobile: stack vertically if needed */
  .module-header {
    padding: 12px 16px 0;
  }

  .module-header-inner {
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .module-header-left {
    min-width: 0;
    width: 100%;
    flex: 1 1 100%;
  }

  .module-header-title {
    font-size: 1rem;
    line-height: 1.3;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .module-header-desc {
    display: none;
  }

  .module-xp-badge {
    display: none;
  }

  .module-header-right {
    flex-shrink: 0;
    align-self: flex-start;
    padding-left: 58px;
    /* align with text if back button is 44px + 14px gap */
    margin-top: -8px;
    /* pull closer since it wrapped */
  }

  .module-progress-tag {
    font-size: 0.75rem;
    padding: 6px 12px;
  }

  /* Hub topbar */
  .hub-topbar-desc {
    display: none;
  }

  .hub-topbar-progress-track {
    width: 60px;
  }

  /* Lesson typography for mobile reading */
  .lesson-viewer h1,
  .lesson-viewer h2 {
    font-size: clamp(1.25rem, 5vw, 1.5rem);
    line-height: 1.3;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
  }

  .lesson-viewer h3 {
    font-size: clamp(1.1rem, 4vw, 1.25rem);
    overflow-wrap: break-word;
    word-break: normal;
  }

  .lesson-viewer p,
  .lesson-viewer li {
    font-size: 1rem;
    line-height: 1.6;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .lesson-viewer blockquote {
    padding: var(--sp-sm) 12px;
    font-size: 0.9rem;
    overflow-wrap: break-word;
  }

  /* Force all figures to full-width on mobile */
  .lesson-viewer figure[data-width] {
    max-width: 100% !important;
  }

  /* Math block overflow */
  .lesson-viewer .math-block {
    max-width: 100%;
    overflow-x: auto;
    padding: var(--sp-md) var(--sp-sm);
  }

  /* Splash logo responsive */
  .module-splash-logo-img {
    width: clamp(160px, 55vw, 220px);
  }

  /* Navigation buttons */
  .module-nav-btn {
    font-size: 0.85rem;
    padding: 10px 14px;
    min-height: 44px;
  }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {

  .module-nav-btn,
  .module-nav-btn--next,
  .module-nav-btn--complete,
  .module-nav-btn--completed,
  .module-optional-quiz,
  .module-back-btn,
  .module-nav-item,
  .module-content-card,
  .module-reward-card,
  .module-tip-card,
  .module-xp-badge,
  .module-nav-indicator {
    transition: none !important;
    animation: none !important;
  }

  .lesson-fade-in {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}


/* Ã¢â€â‚¬Ã¢â€â‚¬ Dashboard Welcome Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬ */




/* Ã¢â€â‚¬Ã¢â€â‚¬ Module View Layout (class-based) Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬ */












/* ══════════════════════════════════════════════════════════════════════════
   OVERHAUL VISUAL V2 — Gamified UI System
   ══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Streak Heartbeat ─────────────────────────────────────────────── */
.streak-pulse {
  display: inline-flex;
  animation: heartbeat var(--streak-speed, 1.5s) ease-in-out infinite;
}

.streak-pulse--dead {
  animation: none;
  opacity: 0.35;
  filter: grayscale(1);
}

.streak-pulse--dead .streak-pulse {
  animation: none;
}

@keyframes heartbeat {

  0%,
  100% {
    transform: scale(1);
  }

  25% {
    transform: scale(1.18);
  }

  35% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.12);
  }
}

/* Streak tier glows */
.streak-badge--warm {
  background: linear-gradient(135deg, #FFF3E0, #FFE0B2) !important;
  border-color: #FFB74D !important;
  color: #E65100 !important;
  box-shadow: 0 0 12px rgba(255, 152, 0, 0.2);
}

.streak-badge--hot {
  background: linear-gradient(135deg, #FFEBEE, #FFCDD2) !important;
  border-color: #EF5350 !important;
  color: #C62828 !important;
  box-shadow: 0 0 16px rgba(244, 67, 54, 0.25);
}

.streak-badge--perfect {
  background: linear-gradient(135deg, #FFF8E1, #FFECB3) !important;
  border-color: #FFD54F !important;
  color: #F57F17 !important;
  box-shadow: 0 0 20px rgba(255, 193, 7, 0.35), 0 0 40px rgba(255, 193, 7, 0.15);
}

/* ── 2. Aura Viva — Ambient Glow System ──────────────────────────────── */
.area-mini-card {
  position: relative;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.area-mini-card::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  background: radial-gradient(ellipse at center,
      var(--card-glow, rgba(108, 43, 255, 0.06)) 0%,
      transparent 70%);
  z-index: -1;
  opacity: var(--card-glow-opacity, 0);
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.area-mini-card:hover {
  transform: translateY(-4px);
}

.area-mini-card:hover::before {
  opacity: 1;
}

/* Per-area glow tokens */
.area-mini-card[data-area="matematicas"] {
  --card-glow: rgba(0, 229, 255, 0.12);
}

.area-mini-card[data-area="lectura-critica"] {
  --card-glow: rgba(255, 152, 0, 0.12);
}

.area-mini-card[data-area="ciencias-naturales"] {
  --card-glow: rgba(0, 200, 83, 0.12);
}

.area-mini-card[data-area="sociales-y-ciudadanas"] {
  --card-glow: rgba(211, 47, 47, 0.12);
}

.area-mini-card[data-area="ingles"] {
  --card-glow: rgba(98, 0, 234, 0.12);
}

/* Hover shadows per area */
.area-mini-card[data-area="matematicas"]:hover {
  box-shadow: var(--shadow-mat);
}

.area-mini-card[data-area="lectura-critica"]:hover {
  box-shadow: var(--shadow-lec);
}

.area-mini-card[data-area="ciencias-naturales"]:hover {
  box-shadow: var(--shadow-nat);
}

.area-mini-card[data-area="sociales-y-ciudadanas"]:hover {
  box-shadow: var(--shadow-soc);
}

.area-mini-card[data-area="ingles"]:hover {
  box-shadow: var(--shadow-eng);
}

/* Glow intensity levels (set via JS data-glow attr) */
.area-mini-card[data-glow="none"]::before {
  opacity: 0;
}

.area-mini-card[data-glow="low"]::before {
  opacity: 0.4;
}

.area-mini-card[data-glow="medium"]::before {
  opacity: 0.7;
}

.area-mini-card[data-glow="high"]::before {
  opacity: 1;
  animation: aura-breathe 3s ease-in-out infinite;
}

@keyframes aura-breathe {

  0%,
  100% {
    opacity: 0.8;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}

/* ── 3. Area-colored border accent ───────────────────────────────────── */
.area-mini-card[data-area="matematicas"] {
  border-left: 3px solid var(--area-mat);
}

.area-mini-card[data-area="lectura-critica"] {
  border-left: 3px solid var(--area-lec);
}

.area-mini-card[data-area="ciencias-naturales"] {
  border-left: 3px solid var(--area-nat);
}

.area-mini-card[data-area="sociales-y-ciudadanas"] {
  border-left: 3px solid var(--area-soc);
}

.area-mini-card[data-area="ingles"] {
  border-left: 3px solid var(--area-eng);
}

/* ── 4. Gamified Stat Cards ──────────────────────────────────────────── */
.progress-stat-card {
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.progress-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-violet-sm);
}

/* ── 5. XP-Style Progress Bars (gradient) ────────────────────────────── */
.xp-bar-bg {
  width: 100%;
  height: 10px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.xp-bar-fill {
  height: 100%;
  border-radius: 5px;
  position: relative;
  transition: width 1.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.xp-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.25), transparent);
  border-radius: 5px 5px 0 0;
}

/* ── 6. Radar Chart — Premium Pentagrama ─────────────────────────────── */
.radar-chart-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: var(--sp-lg) 0;
  min-height: 420px;
}

.radar-chart-svg {
  width: 100%;
  height: auto;
}

.radar-label {
  font-family: var(--font-family);
  pointer-events: none;
}

.radar-value-label {
  font-family: var(--font-family);
  pointer-events: none;
}

.radar-dot {
  cursor: pointer;
  filter: drop-shadow(0 0 0px transparent);
  transition: filter 0.3s ease;
}

.radar-dot:hover {
  filter: drop-shadow(0 0 10px currentColor);
}

.radar-polygon-fill {
  transform-origin: center;
  animation: radarReveal 1s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes radarReveal {
  from {
    transform: scale(0);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Callout tooltip */
.radar-callout-box {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  background: var(--bg-white, #fff);
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 10px 20px;
  border-radius: var(--r-md);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  transform: translate(-50%, -50%) scale(0.7);
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  z-index: 20;
  white-space: nowrap;
}

.radar-callout-box.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ── 7. Creative Empty States ────────────────────────────────────────── */
.empty-state-creative {
  text-align: center;
  padding: var(--sp-3xl) var(--sp-xl);
  background: linear-gradient(180deg, rgba(108, 43, 255, 0.03) 0%, transparent 100%);
  border-radius: var(--r-xl);
  border: 2px dashed rgba(108, 43, 255, 0.12);
}

.empty-state-creative .empty-icon-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(108, 43, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-lg);
}

.empty-state-creative .empty-icon-ring .material-symbols-outlined {
  font-size: 36px;
  color: var(--violet);
  opacity: 0.5;
}

.empty-state-creative .empty-mascot {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(108, 43, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-lg);
  border: 2px dashed rgba(108, 43, 255, 0.15);
}

.empty-state-creative h3 {
  font-size: 1.1rem;
  font-weight: var(--fw-bold);
  margin-bottom: var(--sp-sm);
  color: var(--text-primary);
}

.empty-state-creative p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 300px;
  margin: 0 auto var(--sp-lg);
  line-height: 1.6;
}

/* ── 8. Profile Player Hub — Duolingo-Inspired Redesign ──────────────── */

/* 2-Column Layout */
.profile-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--sp-xl);
  align-items: start;
}

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

.profile-sidebar {
  min-width: 0;
}

/* Section heading (Estadísticas, etc.) */
.profile-section-heading {
  font-size: 1.05rem;
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin-bottom: var(--sp-md);
}

/* Hero Banner */
.profile-hero {
  background: linear-gradient(135deg, #2D1B69 0%, #1A0A3E 100%);
  border-radius: var(--r-xl);
  padding: var(--sp-2xl) var(--sp-xl);
  display: flex;
  align-items: center;
  gap: var(--sp-xl);
  margin-bottom: var(--sp-xl);
  position: relative;
  overflow: hidden;
  color: #fff;
}

.profile-hero-glow {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(108, 43, 255, 0.35), transparent 70%);
  pointer-events: none;
}

.profile-hero-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--magenta));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: var(--fw-extra);
  color: #fff;
  flex-shrink: 0;
  border: 3px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 24px rgba(108, 43, 255, 0.4);
  letter-spacing: 1px;
}

.profile-hero-info {
  flex: 1;
  z-index: 1;
}

.profile-hero-name {
  font-size: 1.5rem;
  font-weight: var(--fw-extra);
  margin-bottom: 2px;
}

.profile-hero-username {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
}

.profile-hero-since {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: var(--sp-sm);
}

.profile-hero-badges {
  display: flex;
  gap: var(--sp-sm);
  flex-wrap: wrap;
  margin-top: var(--sp-xs);
}

.profile-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: var(--fw-bold);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
}

.profile-hero-badge--premium {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.25), rgba(255, 152, 0, 0.25));
  color: #FFD54F;
}

/* Stats 2×2 Grid */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-md);
  margin-bottom: var(--sp-xl);
}

.profile-stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.profile-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-violet-sm);
}

.profile-stat-icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 4px;
}

.profile-stat-value {
  font-size: 1.4rem;
  font-weight: var(--fw-extra);
  color: var(--text-primary);
  line-height: 1.2;
}

.profile-stat-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Section header with "VER TODOS" link */
.profile-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-lg);
}

.profile-see-all {
  font-size: 0.78rem;
  font-weight: var(--fw-bold);
  color: var(--violet);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
}

.profile-see-all:hover {
  text-decoration: underline;
}

/* Profile sections */
.profile-section-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-xl);
  margin-bottom: var(--sp-lg);
  transition: box-shadow 0.25s var(--ease);
}

.profile-section-card:hover {
  box-shadow: var(--shadow-violet-sm);
}

.profile-section-title {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-size: 1rem;
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin-bottom: var(--sp-lg);
}

.profile-section-title .material-symbols-outlined {
  color: var(--violet);
  font-size: 20px;
}

/* Achievements Grid */
.profile-achievements-grid {
  display: flex;
  gap: var(--sp-lg);
  flex-wrap: wrap;
}

.profile-achievement {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 80px;
  text-align: center;
}

.profile-achievement-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--violet), var(--magenta));
  box-shadow: 0 3px 12px rgba(108, 43, 255, 0.3);
  transition: transform 0.2s var(--ease);
}

.profile-achievement-circle:hover {
  transform: scale(1.1);
}

.profile-achievement--locked .profile-achievement-circle {
  background: var(--bg-alt);
  box-shadow: none;
  opacity: 0.45;
  filter: grayscale(0.6);
}

.profile-achievement-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.2;
  font-weight: var(--fw-medium);
}

.profile-achievement--locked .profile-achievement-label {
  opacity: 0.5;
}

/* Preferences form */
.profile-prefs-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

/* Social Card */
.profile-social-card {
  padding: 0 !important;
  overflow: hidden;
}

.profile-social-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.profile-social-tab {
  flex: 1;
  padding: var(--sp-md);
  font-size: 0.78rem;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  border-bottom: 2px solid transparent;
}

.profile-social-tab.active {
  color: var(--violet);
  border-bottom-color: var(--violet);
}

.profile-social-empty {
  padding: var(--sp-xl);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-sm);
}

.profile-social-empty p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 220px;
  line-height: 1.5;
}

/* Upgrade CTA Card */
.profile-upgrade-card {
  background: linear-gradient(135deg, #2D1B69 0%, #6C2BFF 100%);
  border-radius: var(--r-xl);
  padding: var(--sp-xl);
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.profile-upgrade-glow {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15), transparent 70%);
  pointer-events: none;
}

.profile-upgrade-card h4 {
  font-size: 1.1rem;
  font-weight: var(--fw-bold);
  margin: var(--sp-sm) 0;
  position: relative;
  z-index: 1;
}

.profile-upgrade-card p {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: var(--sp-md);
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

.profile-upgrade-card .btn {
  position: relative;
  z-index: 1;
  background: #fff;
  color: var(--violet);
  font-weight: var(--fw-bold);
  border: none;
}

.profile-upgrade-card .btn:hover {
  background: rgba(255, 255, 255, 0.9);
}

/* ── Dark Mode overrides for Profile ─────────────────────────────────── */
body.dark-mode .profile-section-heading {
  color: #e0e0e0;
}

body.dark-mode .profile-stat-card {
  background: #1e1e2e;
  border-color: #2a2a3a;
}

body.dark-mode .profile-stat-value {
  color: #e0e0e0;
}

body.dark-mode .profile-stat-label {
  color: #9CA3AF;
}

body.dark-mode .profile-section-card {
  background: #1e1e2e;
  border-color: #2a2a3a;
}

body.dark-mode .profile-section-title {
  color: #e0e0e0;
}

body.dark-mode .profile-social-tabs {
  border-bottom-color: #2a2a3a;
}

body.dark-mode .profile-social-tab {
  color: #9CA3AF;
}

body.dark-mode .profile-social-tab.active {
  color: var(--violet);
}

body.dark-mode .profile-social-empty p {
  color: #9CA3AF;
}

body.dark-mode .profile-achievement--locked .profile-achievement-circle {
  background: #2a2a3a;
}

body.dark-mode .profile-achievement-label {
  color: #9CA3AF;
}

body.dark-mode .settings-label {
  color: #e0e0e0;
}

body.dark-mode .form-input {
  background: #161625;
  border-color: #2a2a3a;
  color: #e0e0e0;
}

/* ── 9. Unified micro-interaction for all interactive cards ──────────── */
.stats-card,
.hero-card,
.progress-area-card,
.progress-route-item,
.progress-recommendation-card,
.hub-utility-card,
.hub-module-card {
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.stats-card:hover,
.hero-card:hover,
.progress-area-card:hover,
.progress-route-item:hover,
.hub-utility-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-violet-md);
}

/* ── 10. Section fade-in for Progress/Profile pages ──────────────────── */
.section-fade-in {
  opacity: 0;
  transform: translateY(16px);
  animation: sectionReveal 0.6s ease forwards;
}

@keyframes sectionReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-fade-in:nth-child(1) {
  animation-delay: 0ms;
}

.section-fade-in:nth-child(2) {
  animation-delay: 80ms;
}

.section-fade-in:nth-child(3) {
  animation-delay: 160ms;
}

.section-fade-in:nth-child(4) {
  animation-delay: 240ms;
}

.section-fade-in:nth-child(5) {
  animation-delay: 320ms;
}

.section-fade-in:nth-child(6) {
  animation-delay: 400ms;
}

/* ── 11. Responsive adjustments for overhaul ─────────────────────────── */
@media (max-width: 900px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-sidebar {
    order: 2;
  }
}

@media (max-width: 768px) {
  .profile-hero {
    flex-direction: column;
    text-align: center;
  }

  .profile-hero-since {
    justify-content: center;
  }

  .profile-hero-badges {
    justify-content: center;
  }

  .profile-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .profile-achievements-grid {
    justify-content: center;
  }

  .radar-chart-container {
    min-height: 280px;
  }
}

/* ══════════════════════════════════════════════════════════════
   Quest Log System (Quizzes View)
   ══════════════════════════════════════════════════════════════ */

.quest-pills-bar {
  display: flex;
  gap: 8px;
  padding: 0 0 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.quest-pills-bar::-webkit-scrollbar {
  display: none;
}

.quest-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--r-full);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border: 2px solid var(--border);
  background: var(--bg-white);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.quest-pill:hover {
  border-color: var(--pill-color, var(--violet));
  color: var(--pill-color, var(--violet));
}

.quest-pill.active {
  background: var(--pill-color, var(--violet));
  border-color: var(--pill-color, var(--violet));
  color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--pill-color, var(--violet)) 25%, transparent);
}

/* Area summary header */
.quest-area-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-white);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.quest-area-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.quest-area-info {
  flex: 1;
}

.quest-area-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 2px;
}

.quest-area-stats {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

.quest-area-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.quest-area-pct {
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 32px;
  text-align: right;
}

.quest-area-progress {
  width: 100px;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--r-full);
  overflow: hidden;
}

.quest-area-progress-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.6s ease;
}

/* Accordion groups */
.quest-group {
  margin-bottom: 10px;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-white);
}

.quest-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.quest-group-header:hover {
  background: var(--bg-primary);
}

.quest-group-title {
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.quest-group-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.quest-group-chevron {
  font-size: 20px;
  color: var(--text-secondary);
  transition: transform 0.25s ease;
}

.quest-group.open .quest-group-chevron {
  transform: rotate(180deg);
}

.quest-group-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  border-top: 0px solid transparent;
}

.quest-group.open .quest-group-body {
  max-height: 600px;
  border-top: 1px solid var(--border);
}

/* Quest items */
.quest-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
  border-bottom: 1px solid var(--bg-secondary);
}

.quest-item:last-child {
  border-bottom: none;
}

.quest-item:hover {
  background: var(--bg-primary);
}

.quest-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 17px;
}

.quest-item-body {
  flex: 1;
  min-width: 0;
}

.quest-item-title {
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quest-item-meta {
  font-size: 0.73rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.quest-item-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.quest-item-status--completed {
  background: rgba(34, 197, 94, 0.1);
  color: #16A34A;
}

.quest-item-status--retry {
  background: rgba(234, 179, 8, 0.1);
  color: #CA8A04;
}

.quest-item-status--new {
  background: rgba(108, 43, 255, 0.08);
  color: var(--violet);
}

.quest-item-arrow {
  color: var(--text-secondary);
  font-size: 18px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.quest-item:hover .quest-item-arrow {
  opacity: 1;
}

/* Curated quiz highlight */
.quest-curated-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--quest-color, var(--violet));
  padding: 10px 18px 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Cupo badge */
.quest-cupo {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-full);
  font-size: 0.82rem;
  font-weight: 600;
}

.quest-cupo--available {
  background: rgba(108, 43, 255, 0.08);
  color: var(--violet);
}

.quest-cupo--exhausted {
  background: rgba(239, 68, 68, 0.08);
  color: var(--red);
}

@media (max-width: 768px) {
  .quest-area-summary {
    flex-wrap: wrap;
    gap: 12px;
  }

  .quest-area-progress-wrap {
    width: 100%;
  }

  .quest-area-progress {
    flex: 1;
  }
}

/* ══════════════════════════════════════════════════════════════
   Exam Arena System (Simulacros View)
   ══════════════════════════════════════════════════════════════ */

.arena-hero {
  background: var(--bg-white);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.arena-hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.arena-hero-title {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--violet);
}

.arena-hero-best {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: var(--r-full);
  background: rgba(234, 179, 8, 0.1);
  color: #CA8A04;
  font-size: 0.82rem;
  font-weight: 700;
}

/* CSS-only bar chart */
.arena-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 100px;
  padding: 0 4px;
}

.arena-chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.arena-chart-bar {
  width: 100%;
  max-width: 40px;
  min-height: 4px;
  border-radius: 4px 4px 0 0;
  transition: height 0.6s ease;
}

.arena-chart-label {
  font-size: 0.62rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: center;
}

.arena-chart-val {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Split layout */
.arena-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.arena-start,
.arena-history {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.arena-section-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

/* Challenge card */
.arena-challenge {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.arena-challenge:hover {
  border-color: var(--challenge-color, var(--violet));
  box-shadow: 0 4px 16px color-mix(in srgb, var(--challenge-color, var(--violet)) 12%, transparent);
  transform: translateY(-1px);
}

.arena-challenge-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.arena-challenge-body {
  flex: 1;
  min-width: 0;
}

.arena-challenge-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.arena-challenge-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.arena-challenge-btn {
  padding: 6px 16px;
  border-radius: var(--r-full);
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.arena-challenge-btn--primary {
  background: var(--violet);
  color: #fff;
}

.arena-challenge-btn--primary:hover {
  filter: brightness(1.1);
}

.arena-challenge-btn--outline {
  background: transparent;
  border: 2px solid var(--challenge-color, var(--violet));
  color: var(--challenge-color, var(--violet));
}

.arena-challenge-btn--resume {
  background: #D97706;
  color: #fff;
}

/* History battle cards */
.arena-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: background 0.15s ease;
}

.arena-history-item:hover {
  background: var(--bg-primary);
}

.arena-history-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.arena-history-body {
  flex: 1;
  min-width: 0;
}

.arena-history-title {
  font-size: 0.84rem;
  font-weight: 600;
}

.arena-history-date {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.arena-history-score {
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: var(--r-full);
}

.arena-history-empty {
  text-align: center;
  padding: 32px 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

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

/* ════════════════════════════════════════════════════════════
   LEARN PAGE — Duolingo-style Aprender
   ════════════════════════════════════════════════════════════ */

/* ── Unified Top Bar: Tabs + Stats ── */
.learn-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 16px 0;
  margin-bottom: 20px;
  overflow: visible;
  position: relative;
  z-index: 1000;
  flex-shrink: 0;
}

.learn-topbar::-webkit-scrollbar {
  display: none;
}

/* Subject tabs inside the topbar */
.learn-topbar .learn-tabs {
  display: flex;
  gap: 6px;
  flex-shrink: 1;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.learn-topbar .learn-tabs::-webkit-scrollbar {
  display: none;
}

.learn-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 3px solid var(--border-subtle);
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.learn-tab:hover {
  border-color: var(--tab-color, #6C2BFF);
  color: var(--tab-color, #6C2BFF);
  background: color-mix(in srgb, var(--tab-color, #6C2BFF) 6%, var(--bg-white));
}

.learn-tab.active {
  border-width: 3px;
  border-color: var(--tab-color, #6C2BFF);
  background: transparent;
  color: var(--tab-color, #6C2BFF);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--tab-color, #6C2BFF) 15%, transparent);
}

.learn-tab-icon {
  font-size: 18px;
}

.learn-tab-label {
  font-size: 0.85rem;
}

/* Stats group (right side of topbar) */
.learn-stats-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.learn-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-primary);
  text-decoration: none;
}

.learn-stat:hover {
  background: var(--bg-elevated);
  border-color: var(--border);
}

.learn-stat-icon {
  font-size: 19px;
}

.learn-stat-icon--streak {
  color: #9CA3AF;
}

.learn-stat-icon--streak.active {
  color: #F59E0B;
}

/* SVG icon override for streak */
.learn-stat-icon--svg {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.learn-stat-icon--diamond {
  color: #3B82F6;
}

.learn-stat-icon--league {
  color: #6C2BFF;
}

/* League stat — special layout with rank */
.learn-stat--league {
  gap: 6px;
}

.learn-league-info {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.learn-league-rank {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-primary);
}

.learn-league-tier {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* League trend indicator */
.learn-league-trend {
  display: inline-flex;
  align-items: center;
}

.learn-trend-icon {
  font-size: 16px;
}

.trend-up .learn-trend-icon {
  color: #22C55E;
}

.trend-down .learn-trend-icon {
  color: #EF4444;
}

/* ── Main Body: Tree + Side Cards ── */
.dashboard-layout:has(.learn-body) {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.main-content:has(.learn-body) {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}

.learn-body {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  align-items: start;
  flex: 1;
  min-height: 0;
  height: auto;
  overflow: hidden;
}

.learn-tree-col {
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scroll-gutter: stable;
  padding-right: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.12) transparent;
}

.learn-tree-col::-webkit-scrollbar {
  width: 6px;
}

.learn-tree-col::-webkit-scrollbar-track {
  background: transparent;
}

.learn-tree-col::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}

.learn-side-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  height: fit-content;
  max-height: calc(100vh - 120px);
  overflow: visible;
}

/* ── Area Header ── */
.learn-area-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--hub-color, var(--violet));
  border-radius: 14px;
  margin-bottom: 20px;
  gap: 16px;
}

.learn-area-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #FFFFFF;
  margin: 0;
}

.learn-area-desc {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 2px 0 0 0;
}

.learn-area-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.learn-area-pct {
  font-size: 0.85rem;
  font-weight: 700;
  color: #FFFFFF;
}

.learn-area-progress-track {
  width: 100px;
  height: 8px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  overflow: hidden;
}

.learn-area-progress-fill {
  height: 100%;
  border-radius: 10px;
  background: var(--bg-white) !important;
  transition: width 0.5s ease;
}

/* ── Empty State ── */
.learn-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  color: var(--text-secondary);
  gap: 12px;
}

.learn-empty-state p {
  max-width: 280px;
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ── Side Cards (Duolingo-style) ── */
.learn-side-card {
  display: block;
  background: var(--bg-white);
  border: 1.5px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.learn-side-card:hover {
  border-color: #D1D5DB;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.learn-side-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.learn-side-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.learn-side-card-link {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--violet);
  text-decoration: none;
}

.learn-side-card-link:hover {
  text-decoration: underline;
}

.learn-side-card-body {
  display: flex;
  align-items: center;
  gap: 14px;
}

.learn-side-card-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.learn-side-card-icon--league {
  background: linear-gradient(135deg, #C0C0C0, #8e8e8e);
  color: white;
}

.learn-side-card-icon--league .material-symbols-outlined {
  font-size: 22px;
}

.learn-side-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

/* ── Daily Challenge Item (compact) ── */
.learn-challenge-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.learn-challenge-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #F59E0B, #EAB308);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.learn-challenge-icon .material-symbols-outlined {
  font-size: 20px;
}

.learn-challenge-info {
  flex: 1;
  min-width: 0;
}

.learn-challenge-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  margin-bottom: 6px;
}

.learn-challenge-bar-bg {
  width: 100%;
  height: 10px;
  background: var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
}

.learn-challenge-bar-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, #F59E0B, #22C55E);
  transition: width 0.5s ease;
}

.learn-challenge-progress-text {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* ── Legal Links (in side column) ── */
.learn-side-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 12px 0 0;
}

.learn-side-legal a {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.learn-side-legal a:hover {
  color: var(--violet);
  text-decoration: underline;
}

.learn-side-legal-sep {
  color: var(--text-secondary);
  opacity: 0.3;
  font-size: 0.72rem;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .learn-body {
    grid-template-columns: 1fr;
    flex: 1;
    min-height: 0;
    height: auto;
    overflow: hidden;
  }

  .learn-tree-col {
    height: 100%;
    overflow-y: auto;
  }

  .learn-side-col {
    display: none;
  }
}

@media (max-width: 768px) {
  .learn-topbar {
    flex-direction: column;
    gap: 10px;
    padding: 0 0 12px 0;
    position: relative;
  }

  .learn-topbar::after {
    content: '';
    position: absolute;
    top: 0;
    right: -16px;
    width: 48px;
    height: 48px;
    /* approx height of tabs */
    background: linear-gradient(to right, transparent, var(--bg-primary, #ffffff) 85%);
    pointer-events: none;
    z-index: 10;
  }

  .learn-topbar .learn-tabs {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
    scroll-padding-right: 32px;
  }

  .learn-stats-group {
    width: 100%;
    justify-content: center;
  }

  .learn-stat {
    padding: 5px 10px;
    font-size: 0.82rem;
  }

  .learn-tab {
    padding: 7px 12px;
    font-size: 0.8rem;
    scroll-snap-align: start;
  }

  .learn-area-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .learn-area-progress-track {
    width: 80px;
  }

  .learn-side-col {
    flex-direction: column;
  }

  .learn-side-col>* {
    flex: none;
  }

  .learn-side-legal {
    justify-content: center;
  }
}

/* ════════════════════════════════════════════════════════════
   STREAK — Two-level: Hover Card + Full Modal
   ════════════════════════════════════════════════════════════ */

/* ── Hover Card (quick view on flame hover) ── */
.learn-stat-wrap {
  position: relative;
}

.streak-hover-card {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  display: flex;
  flex-direction: column;
  background: var(--bg-white, #fff);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-subtle);
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 120px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
  pointer-events: none;
}

/* Inside the shell sidebar, use fixed positioning to avoid clipping */
.shell-side-col .streak-hover-card {
  position: fixed;
  top: auto;
  right: 28px;
  width: 360px;
  max-height: calc(100vh - 80px);
}

.streak-hover-card.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.streak-hover-handle {
  display: none;
  /* Only visible on mobile */
}

/* Top Section (Soft Background) */
.streak-hover-top {
  background: linear-gradient(135deg, #FAF5FF 0%, #F3E8FF 100%);
  padding: 28px 24px;
}

.streak-hover-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.streak-hover-hero-left {
  display: flex;
  flex-direction: column;
}

.streak-hover-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
}

.streak-hover-count {
  font-size: 2.4rem;
  font-weight: 900;
  color: #7C3AED;
  line-height: 1;
}

.streak-hover-label {
  font-size: 1.3rem;
  font-weight: 800;
  color: #9333EA;
  opacity: 0.9;
}

.streak-hover-msg {
  font-size: 0.95rem;
  color: #6B7280;
  margin: 10px 0 0;
  line-height: 1.4;
  font-weight: 600;
  max-width: 240px;
}

.streak-hover-flame {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.25;
}

.streak-hover-flame-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

/* Week Dots in White Box */
.streak-hover-week-box {
  background: var(--bg-white);
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.streak-hover-week {
  display: flex;
  justify-content: space-between;
}

.streak-dot-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.streak-dot-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: #9CA3AF;
  text-transform: uppercase;
}

.streak-dot-col.is-today .streak-dot-name {
  color: #F59E0B;
  /* Orange for today as per screenshot */
  font-weight: 800;
}

.streak-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.streak-dot.active {
  background: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.streak-dot.active .streak-check-icon {
  font-size: 16px;
  color: #292524;
  font-weight: 700;
  font-variation-settings: 'FILL' 1;
}

/* Ice/freeze indicator — today not yet completed */
.streak-dot.at-risk {
  background: linear-gradient(135deg, #38BDF8, #0EA5E9);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
  animation: iceShimmer 2s ease-in-out infinite;
}

.streak-dot.at-risk .streak-ice-icon {
  font-size: 16px;
  color: #fff;
  font-variation-settings: 'FILL' 1;
}

@keyframes iceShimmer {

  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
  }

  50% {
    box-shadow: 0 0 8px 4px rgba(56, 189, 248, 0.3);
  }
}

/* Bottom Section — Duolingo-style stacked layout */
.streak-hover-bottom {
  background: var(--bg-white);
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Friends Card — vertical hero with gradient fade ── */
.streak-hover-friends-card {
  background: linear-gradient(145deg, #7C3AED 0%, #6D28D9 100%);
  border-radius: 18px;
  color: white;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Hero image container with gradient fade edges */
.streak-hover-friends-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 16px 0;
  position: relative;
}

/* Gradient fade — smooths the bottom edge into the purple card */
.streak-hover-friends-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(to bottom, transparent, #7C3AED);
  pointer-events: none;
  z-index: 2;
}

.streak-hover-friends-img {
  width: 220px;
  height: auto;
  max-height: 160px;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

/* Text + button body */
.streak-hover-friends-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 20px 18px;
  gap: 6px;
}

.streak-hover-friends-body strong {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.2px;
}

.streak-hover-friends-body span {
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0.9;
  margin-bottom: 6px;
}

.streak-hover-friends-btn {
  background: var(--bg-white);
  color: #7C3AED;
  border: none;
  border-radius: 12px;
  padding: 11px 16px;
  width: 100%;
  font-weight: 900;
  font-size: 0.85rem;
  letter-spacing: 0.6px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.streak-hover-friends-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

/* ── Sociedad de Rachas Section ── */
.streak-hover-sociedad {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-white);
  border: 1.5px solid var(--border-subtle, #E5E7EB);
  border-radius: 16px;
  padding: 16px;
}

.streak-sociedad-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #F3E8FF 0%, #EDE9FE 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.streak-sociedad-icon .material-symbols-outlined {
  font-size: 24px;
  color: #7C3AED;
  font-variation-settings: 'FILL' 1;
}

.streak-sociedad-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.streak-sociedad-info strong {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary, #1F2937);
  line-height: 1.3;
}

.streak-sociedad-info span {
  font-size: 0.78rem;
  color: var(--text-muted, #6B7280);
  line-height: 1.45;
  font-weight: 500;
}

/* ── Full-width CTA Button ── */
.streak-hover-cta {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%);
  color: white;
  border: none;
  border-radius: 14px;
  font-weight: 900;
  font-size: 0.9rem;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
  margin-top: auto;
}

.streak-hover-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.4);
  background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
}

/* ── Full Modal Overlay ── */

.streak-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.streak-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.streak-modal {
  width: 450px;
  max-height: 85vh;
  background: var(--bg-white, #fff);
  border-radius: 18px;
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s ease;
}

.streak-modal-overlay.open .streak-modal {
  transform: scale(1) translateY(0);
}

.streak-modal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px 0;
  position: relative;
}

.streak-modal-close {
  position: absolute;
  left: 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
  border-radius: 8px;
  transition: background 0.15s;
}

.streak-modal-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

.streak-modal-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

/* Modal Tabs */
.streak-modal-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-subtle);
  margin-top: 14px;
}

.streak-modal-tab {
  flex: 1;
  padding: 12px 0;
  background: none;
  border: none;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.streak-modal-tab:hover {
  color: var(--text-primary);
}

.streak-modal-tab.active {
  color: #7C3AED;
}

.streak-modal-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: #7C3AED;
  border-radius: 3px 3px 0 0;
}

/* Modal Panels */
.streak-modal-panel {
  padding: 0 22px 22px;
  overflow-y: auto;
  max-height: calc(85vh - 110px);
}

/* Modal Hero */
.streak-modal-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 16px;
  border-bottom: 1px solid #F1F5F9;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #F3E8FF 0%, #FDF2F8 100%);
  margin: 0 -22px;
  padding: 22px 22px 16px;
}

.streak-modal-hero-count {
  font-size: 2rem;
  font-weight: 900;
  color: #7C3AED;
  line-height: 1;
}

.streak-modal-hero-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #9333EA;
  margin-top: 2px;
  display: block;
}

.streak-modal-hero-flame {
  opacity: 0.2;
}

.streak-modal-hero-flame .material-symbols-outlined {
  font-size: 48px;
  color: #C084FC;
}

/* Modal Reminder */
.streak-modal-reminder {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #FFFBEB;
  border: 1.5px solid #FDE68A;
  border-radius: 12px;
  padding: 12px 16px;
  margin: 18px 0;
}

.streak-modal-reminder-icon {
  font-size: 24px;
  color: #F59E0B;
  flex-shrink: 0;
}

.streak-modal-reminder div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.streak-modal-reminder span {
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.streak-modal-reminder-link {
  font-size: 0.78rem;
  font-weight: 800;
  color: #7C3AED;
  text-decoration: none;
}

.streak-modal-reminder-link:hover {
  text-decoration: underline;
}

/* Calendar (inside modal) */
.streak-modal-section-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 16px 0 10px;
}

.streak-calendar {
  background: var(--bg-white, #fff);
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px;
}

.streak-calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.streak-cal-arrow {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
  border-radius: 8px;
  transition: background 0.15s;
}

.streak-cal-arrow:hover {
  background: rgba(0, 0, 0, 0.05);
}

.streak-cal-month {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}

.streak-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}

.streak-cal-header {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 6px 0;
}

.streak-cal-day {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  font-size: 0.82rem;
  color: var(--text-primary);
  border-radius: 50%;
  font-weight: 500;
}

.streak-cal-day.empty {
  visibility: hidden;
}

.streak-cal-day.is-future {
  color: #CBD5E1;
}

.streak-cal-day.is-today span {
  background: #E9D5FF;
  color: #7C3AED;
  font-weight: 800;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.streak-cal-day.has-streak span {
  background: linear-gradient(135deg, #A855F7, #7C3AED);
  color: white;
  font-weight: 700;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* At-risk day (today not completed — ice) */
.streak-cal-day.at-risk span {
  background: linear-gradient(135deg, #38BDF8, #0EA5E9);
  color: white;
  font-weight: 700;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: iceShimmer 2s ease-in-out infinite;
}

/* Streak Goal */
.streak-goal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-white, #fff);
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 16px;
}

.streak-goal-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.streak-goal-marker .material-symbols-outlined {
  font-size: 20px;
  color: #F59E0B;
}

.streak-goal-marker span:last-child {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-primary);
}

.streak-goal-end .material-symbols-outlined {
  color: #7C3AED;
}

.streak-goal-track {
  flex: 1;
  height: 10px;
  background: #F1F5F9;
  border-radius: 10px;
  overflow: hidden;
}

.streak-goal-fill {
  height: 100%;
  background: linear-gradient(90deg, #A855F7, #7C3AED);
  border-radius: 10px;
  transition: width 0.5s ease;
}

/* Society */
.streak-society-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-white, #fff);
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 16px;
}

.streak-society-icon {
  font-size: 28px;
  color: #9CA3AF;
  flex-shrink: 0;
}

.streak-society-icon.unlocked {
  color: #F59E0B;
}

.streak-society-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Friends Tab (in modal) */
.streak-friends-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
}

.streak-friends-icon-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.streak-friends-flame {
  font-size: 48px;
  color: #A855F7;
  position: absolute;
  top: 0;
}

.streak-friends-people {
  font-size: 36px;
  color: #7C3AED;
  position: absolute;
  bottom: 8px;
}

.streak-friends-text {
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.5;
  max-width: 280px;
  margin-bottom: 24px;
}

.streak-friends-text strong {
  color: #7C3AED;
}

.streak-friends-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 40px;
  background: linear-gradient(135deg, #A855F7, #7C3AED);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.streak-friends-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.streak-friends-cta .material-symbols-outlined {
  font-size: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  .streak-hover-card {
    width: calc(100vw - 32px);
    right: -60px;
  }

  .streak-modal {
    width: calc(100vw - 32px);
    max-height: 90vh;
  }
}


/* .learn-stat-wrap position:relative moved to main rule above */

.streak-popup {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 380px;
  max-height: 85vh;
  background: var(--bg-white, #fff);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border-subtle);
  z-index: 1000;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
}

.streak-popup.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.streak-popup-inner {
  overflow-y: auto;
  max-height: 85vh;
  padding: 0;
}

/* Close */
.streak-popup-close {
  position: absolute;
  top: 12px;
  left: 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
  border-radius: 8px;
  transition: background 0.15s;
  z-index: 2;
}

.streak-popup-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

.streak-popup-title {
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
  padding: 14px 0 0;
  color: var(--text-primary);
}

/* ── Tabs ── */
.streak-popup-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-subtle);
  margin-top: 12px;
}

.streak-popup-tab {
  flex: 1;
  padding: 12px 0;
  background: none;
  border: none;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.streak-popup-tab:hover {
  color: var(--text-primary);
}

.streak-popup-tab.active {
  color: #7C3AED;
}

.streak-popup-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: #7C3AED;
  border-radius: 3px 3px 0 0;
}

/* ── Panels ── */
.streak-popup-panel {
  padding: 0 20px 20px;
}

/* ── Hero ── */
.streak-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px 16px;
  background: linear-gradient(135deg, #F3E8FF 0%, #FDF2F8 100%);
}

.streak-hero-left {
  display: flex;
  flex-direction: column;
}

.streak-hero-count {
  font-size: 2.2rem;
  font-weight: 900;
  color: #7C3AED;
  line-height: 1;
}

.streak-hero-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #9333EA;
  margin-top: 2px;
}

.streak-hero-flame {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.25;
}

.streak-hero-flame .material-symbols-outlined {
  font-size: 56px;
  color: #C084FC;
}

/* ── Reminder ── */
.streak-reminder {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-white, #fff);
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 16px 20px 0;
}

.streak-reminder-icon {
  font-size: 28px;
  color: #F59E0B;
  flex-shrink: 0;
}

.streak-reminder-text {
  font-size: 0.85rem;
  color: var(--text-primary);
  display: block;
  line-height: 1.4;
}

.streak-reminder-link {
  font-size: 0.78rem;
  font-weight: 800;
  color: #7C3AED;
  text-decoration: none;
  margin-top: 4px;
  display: inline-block;
}

.streak-reminder-link:hover {
  text-decoration: underline;
}

/* ── Week Dots ── */
.streak-week {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 16px 20px;
}

.streak-dot-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.streak-dot-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.streak-dot-col.is-today .streak-dot-name {
  color: #7C3AED;
  font-weight: 800;
}

.streak-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.streak-dot.active {
  background: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.streak-dot.active .streak-check-icon {
  font-size: 16px;
  color: #292524;
  font-weight: 700;
  font-variation-settings: 'FILL' 1;
}

/* ── Calendar ── */
.streak-calendar-section {
  padding-top: 8px;
}

.streak-section-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 12px;
}

.streak-calendar {
  background: var(--bg-white, #fff);
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px;
}

.streak-calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.streak-cal-arrow {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
  border-radius: 8px;
  transition: background 0.15s;
}

.streak-cal-arrow:hover {
  background: rgba(0, 0, 0, 0.05);
}

.streak-cal-month {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}

.streak-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}

.streak-cal-header {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 6px 0;
}

.streak-cal-day {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  font-size: 0.82rem;
  color: var(--text-primary);
  border-radius: 50%;
  position: relative;
  font-weight: 500;
}

.streak-cal-day.empty {
  visibility: hidden;
}

.streak-cal-day.is-future {
  color: #CBD5E1;
}

.streak-cal-day.is-today span {
  background: #E9D5FF;
  color: #7C3AED;
  font-weight: 800;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.streak-cal-day.has-streak span {
  background: linear-gradient(135deg, #A855F7, #7C3AED);
  color: white;
  font-weight: 700;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.streak-cal-day.at-risk span {
  background: linear-gradient(135deg, #38BDF8, #0EA5E9);
  color: white;
  font-weight: 700;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: iceShimmer 2s ease-in-out infinite;
}

/* ── Streak Goal ── */
.streak-goal-section {
  margin-top: 16px;
}

.streak-goal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-white, #fff);
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 16px;
}

.streak-goal-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.streak-goal-marker .material-symbols-outlined {
  font-size: 20px;
  color: #F59E0B;
}

.streak-goal-marker span:last-child {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-primary);
}

.streak-goal-start .material-symbols-outlined {
  color: #A855F7;
}

.streak-goal-track {
  flex: 1;
  height: 10px;
  background: #F1F5F9;
  border-radius: 10px;
  overflow: hidden;
}

.streak-goal-fill {
  height: 100%;
  background: linear-gradient(90deg, #A855F7, #7C3AED);
  border-radius: 10px;
  transition: width 0.5s ease;
}

/* ── Sociedad ── */
.streak-society {
  margin-top: 16px;
}

.streak-society-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-white, #fff);
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 16px;
}

.streak-society-icon {
  font-size: 28px;
  color: #9CA3AF;
  flex-shrink: 0;
  margin-top: 2px;
}

.streak-society-icon.unlocked {
  color: #F59E0B;
}

.streak-society-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* ── Friends Tab ── */
.streak-friends-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
}

.streak-friends-icon-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.streak-friends-flame {
  font-size: 48px;
  color: #A855F7;
  position: absolute;
  top: 0;
}

.streak-friends-people {
  font-size: 36px;
  color: #7C3AED;
  position: absolute;
  bottom: 8px;
}

.streak-friends-text {
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.5;
  max-width: 280px;
  margin-bottom: 24px;
}

.streak-friends-text strong {
  color: #7C3AED;
}

.streak-friends-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 40px;
  background: linear-gradient(135deg, #A855F7, #7C3AED);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.streak-friends-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.streak-friends-cta .material-symbols-outlined {
  font-size: 20px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .streak-popup {
    width: calc(100vw - 32px);
    right: -60px;
  }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .streak-popup {
    width: calc(100vw - 32px);
    right: -60px;
  }
}

/* ══════════════════════════════════════════════════════════════
   DARK MODE — Learning-Specific Overrides
   ══════════════════════════════════════════════════════════════ */

/* ── Module Layout ── */
[data-theme="dark"] .module-layout {
  background: var(--bg-primary);
}

[data-theme="dark"] .module-header {
  background: var(--bg-white);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
  border-bottom-color: color-mix(in srgb, var(--module-color, var(--violet)) 25%, transparent);
}

[data-theme="dark"] .module-header-title {
  color: var(--text-primary);
}

[data-theme="dark"] .module-content-card {
  background: var(--bg-white);
  border-color: var(--border);
  color: var(--text-primary);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.25),
    0 4px 16px rgba(0, 0, 0, 0.2),
    0 12px 40px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .module-content-card:hover {
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.25),
    0 6px 20px rgba(0, 0, 0, 0.25),
    0 16px 48px rgba(0, 0, 0, 0.12);
}

/* Module content text — all elements must be light */
[data-theme="dark"] .module-content-card h1,
[data-theme="dark"] .module-content-card h2,
[data-theme="dark"] .module-content-card h3,
[data-theme="dark"] .module-content-card h4,
[data-theme="dark"] .module-content-card h5,
[data-theme="dark"] .module-content-card h6,
[data-theme="dark"] .module-content-card p,
[data-theme="dark"] .module-content-card li,
[data-theme="dark"] .module-content-card span,
[data-theme="dark"] .module-content-card strong,
[data-theme="dark"] .module-content-card em,
[data-theme="dark"] .module-content-card label,
[data-theme="dark"] .module-content-card td,
[data-theme="dark"] .module-content-card th,
[data-theme="dark"] .module-content-card a {
  color: var(--text-primary);
}

[data-theme="dark"] .module-content-card a {
  color: #A78BFA;
}

[data-theme="dark"] .module-lesson-badge {
  background: rgba(108, 43, 255, 0.15);
  border-color: rgba(108, 43, 255, 0.2);
}

[data-theme="dark"] .module-lesson-title {
  color: var(--text-primary);
}

[data-theme="dark"] .module-nav-footer {
  background: transparent;
}

[data-theme="dark"] .module-nav-btn.btn-outline {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .module-nav-btn.btn-outline:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: color-mix(in srgb, var(--module-color, var(--violet)) 50%, transparent);
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .module-nav-btn--next {
  box-shadow:
    0 4px 14px color-mix(in srgb, var(--module-color, var(--violet)) 30%, transparent),
    0 1px 3px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .module-nav-btn--completed {
  box-shadow:
    0 4px 14px rgba(16, 185, 129, 0.25),
    0 1px 3px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .module-optional-quiz {
  background: color-mix(in srgb, var(--module-color, var(--violet)) 10%, transparent);
  border-color: color-mix(in srgb, var(--module-color, var(--violet)) 20%, transparent);
  color: color-mix(in srgb, var(--module-color, var(--violet)) 70%, #fff);
}

[data-theme="dark"] .module-optional-quiz:hover {
  background: color-mix(in srgb, var(--module-color, var(--violet)) 18%, transparent);
  border-color: color-mix(in srgb, var(--module-color, var(--violet)) 35%, transparent);
}

[data-theme="dark"] .module-aside {
  background: var(--bg-primary);
}

[data-theme="dark"] .module-aside-heading {
  color: var(--text-secondary);
}

/* Module sidebar nav items */
[data-theme="dark"] .module-nav-item {
  color: var(--text-primary);
  border-color: transparent;
}

[data-theme="dark"] .module-nav-item:hover {
  background: var(--bg-hover);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .module-nav-item.active {
  background: color-mix(in srgb, var(--module-color, var(--violet)) 10%, var(--bg-secondary));
  border-color: color-mix(in srgb, var(--module-color, var(--violet)) 30%, transparent);
}

[data-theme="dark"] .module-nav-item-title {
  color: var(--text-primary);
}

[data-theme="dark"] .module-nav-item-subtitle {
  color: var(--text-secondary);
}

[data-theme="dark"] .module-nav-item-status.completed {
  color: #22C55E;
}

/* Module reward card — dark gold */
[data-theme="dark"] .module-reward-card {
  background: linear-gradient(135deg, rgba(245, 127, 23, 0.12), rgba(255, 193, 7, 0.08));
  border-color: rgba(245, 127, 23, 0.2);
  box-shadow: none;
}

[data-theme="dark"] .module-reward-text strong {
  color: var(--text-primary);
}

[data-theme="dark"] .module-reward-text span {
  color: var(--text-secondary);
}

/* Module tip card */
[data-theme="dark"] .module-tip-card {
  background: var(--bg-secondary);
  border-color: var(--border);
}

[data-theme="dark"] .module-tip-card p,
[data-theme="dark"] .module-tip-card strong {
  color: var(--text-primary);
}

/* Module progress bar track */
[data-theme="dark"] .module-progress-segment {
  background: var(--bg-secondary);
}

/* ── Learn Topbar ── */
[data-theme="dark"] .learn-topbar {
  background: var(--bg-white);
  border-bottom-color: var(--border);
}

[data-theme="dark"] .learn-tab {
  color: var(--text-secondary);
}

[data-theme="dark"] .learn-tab.active {
  color: var(--text-primary);
}

/* ── Skill Tree ── */
[data-theme="dark"] .skill-tree-card {
  background: var(--bg-white);
  border-color: var(--border);
}

[data-theme="dark"] .skill-tree-card:hover {
  box-shadow: var(--shadow-md);
}

/* ── Side Cards ── */
[data-theme="dark"] .learn-side-card {
  background: var(--bg-white);
  border-color: var(--border);
}

[data-theme="dark"] .learn-side-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .learn-side-card-title {
  color: var(--text-primary);
}

[data-theme="dark"] .learn-side-card-desc {
  color: var(--text-secondary);
}

[data-theme="dark"] .learn-side-card-link {
  color: #A78BFA;
}

/* Challenge items */
[data-theme="dark"] .learn-challenge-label {
  color: var(--text-primary);
}

[data-theme="dark"] .learn-challenge-bar-bg {
  background: var(--bg-secondary);
}

[data-theme="dark"] .learn-challenge-progress-text {
  color: var(--text-secondary);
}

/* ── Hub Upsell Card (Skora Super) ── */
[data-theme="dark"] .hub-card-super {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(108, 43, 255, 0.06) 100%);
  border-color: var(--border);
  box-shadow: 0 4px 0 var(--border);
}

[data-theme="dark"] .hub-card-super-title {
  color: var(--text-primary);
}

[data-theme="dark"] .hub-card-super-desc {
  color: var(--text-secondary);
}

/* ── Streak Hover Card ── */
[data-theme="dark"] .streak-hover-card {
  background: var(--bg-white);
  border-color: var(--border);
  box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .streak-hover-top {
  background: var(--bg-primary);
}

[data-theme="dark"] .streak-hover-bottom {
  background: var(--bg-secondary);
}

[data-theme="dark"] .streak-hover-week-box {
  background: var(--bg-secondary);
}

[data-theme="dark"] .streak-hover-msg {
  color: var(--text-secondary);
}

[data-theme="dark"] .streak-hover-count {
  color: #A78BFA;
}

[data-theme="dark"] .streak-hover-label {
  color: #C4B5FD;
}

[data-theme="dark"] .streak-dot {
  background: var(--bg-elevated);
}

[data-theme="dark"] .streak-dot.active {
  background: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

[data-theme="dark"] .streak-dot.active .streak-check-icon {
  color: #292524;
}

[data-theme="dark"] .streak-dot.at-risk {
  background: linear-gradient(135deg, #38BDF8, #0EA5E9);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

[data-theme="dark"] .streak-dot.at-risk .streak-ice-icon {
  color: #fff;
}

[data-theme="dark"] .streak-dot-name {
  color: var(--text-secondary);
}

/* ── Streak Modal ── */
[data-theme="dark"] .streak-modal-overlay {
  background: rgba(0, 0, 0, 0.78);
}

[data-theme="dark"] .streak-modal {
  background: var(--bg-white);
  border: 1px solid var(--border);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .streak-modal-title {
  color: var(--text-primary);
}

[data-theme="dark"] .streak-modal-close {
  color: var(--text-secondary);
}

[data-theme="dark"] .streak-modal-close:hover {
  color: var(--text-primary);
}

[data-theme="dark"] .streak-modal-tab {
  color: var(--text-secondary);
}

[data-theme="dark"] .streak-modal-tab.active {
  color: var(--violet);
  border-bottom-color: var(--violet);
}

/* Hero → dark purple gradient */
[data-theme="dark"] .streak-modal-hero {
  background: linear-gradient(135deg, rgba(108, 43, 255, 0.18) 0%, rgba(124, 58, 237, 0.08) 100%);
  border-bottom-color: var(--border);
}

[data-theme="dark"] .streak-modal-hero-count {
  color: #A78BFA;
}

[data-theme="dark"] .streak-modal-hero-label {
  color: #C4B5FD;
}

[data-theme="dark"] .streak-modal-hero-flame .material-symbols-outlined {
  color: #7C3AED;
}

/* Reminder → dark themed (no yellow) */
[data-theme="dark"] .streak-modal-reminder {
  background: rgba(108, 43, 255, 0.08);
  border-color: rgba(108, 43, 255, 0.2);
}

[data-theme="dark"] .streak-modal-reminder span {
  color: var(--text-primary);
}

[data-theme="dark"] .streak-modal-reminder-icon {
  color: #A78BFA;
}

[data-theme="dark"] .streak-modal-reminder-link {
  color: #A78BFA;
}

/* Calendar → dark */
[data-theme="dark"] .streak-calendar {
  background: var(--bg-secondary);
  border-color: var(--border);
}

[data-theme="dark"] .streak-cal-month {
  color: var(--text-primary);
}

[data-theme="dark"] .streak-cal-header {
  color: var(--text-secondary);
}

[data-theme="dark"] .streak-cal-day {
  color: var(--text-primary);
}

[data-theme="dark"] .streak-cal-day.is-future {
  color: var(--text-secondary);
  opacity: 0.4;
}

[data-theme="dark"] .streak-cal-day.is-today span {
  background: rgba(108, 43, 255, 0.3);
  color: #C4B5FD;
}

[data-theme="dark"] .streak-cal-day.has-streak span {
  background: linear-gradient(135deg, #7C3AED, #6C2BFF);
}

[data-theme="dark"] .streak-cal-day.at-risk span {
  background: linear-gradient(135deg, #38BDF8, #0EA5E9);
  color: white;
}

[data-theme="dark"] .streak-cal-arrow {
  color: var(--text-secondary);
}

[data-theme="dark"] .streak-cal-arrow:hover {
  background: var(--bg-hover);
}

/* Goal bar → dark */
[data-theme="dark"] .streak-goal-bar {
  background: var(--bg-secondary);
  border-color: var(--border);
}

[data-theme="dark"] .streak-goal-track {
  background: var(--bg-elevated);
}

[data-theme="dark"] .streak-goal-marker span:last-child {
  color: var(--text-primary);
}

/* Society card → dark */
[data-theme="dark"] .streak-society-card {
  background: var(--bg-secondary);
  border-color: var(--border);
}

[data-theme="dark"] .streak-society-card p {
  color: var(--text-secondary);
}

/* Section title */
[data-theme="dark"] .streak-modal-section-title {
  color: var(--text-primary);
}

/* Friends panel → dark */
[data-theme="dark"] .streak-friends-empty {
  color: var(--text-primary);
}

[data-theme="dark"] .streak-friends-text {
  color: var(--text-secondary);
}

[data-theme="dark"] .streak-friends-text strong {
  color: var(--text-primary);
}

[data-theme="dark"] .streak-friends-cta {
  background: var(--violet);
  color: #fff;
}

/* ── KaTeX ── */
[data-theme="dark"] .katex,
[data-theme="dark"] .katex .base {
  color: var(--text-primary);
}

/* ── Sidebar ── */
[data-theme="dark"] .sidebar-logo img {
  filter: brightness(0) invert(1);
}

/* ── Bottom Nav ── */
[data-theme="dark"] .bottom-nav {
  background: var(--bg-white);
  border-top-color: var(--border);
}

/* ── Scrollbar ── */
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--border);
}

/* ── Start Label (Continuar tooltip) ── */
[data-theme="dark"] .skill-start-label,
[data-theme="dark"] .skill-start-label::before {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

[data-theme="dark"] .skill-start-label {
  border: 1px solid var(--border);
}

[data-theme="dark"] .skill-start-label::before {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ── Streak Popup (old hover) ── */
[data-theme="dark"] .streak-hero {
  background: var(--bg-primary);
}

[data-theme="dark"] .streak-popup-panel {
  background: var(--bg-white);
}

[data-theme="dark"] .streak-reminder {
  background: var(--bg-secondary);
  border-color: var(--border);
}

[data-theme="dark"] .streak-popup-title {
  color: var(--text-primary);
}

/* ── Blocks (lesson content) dark mode ── */
[data-theme="dark"] .block-heading,
[data-theme="dark"] .block-paragraph,
[data-theme="dark"] .block-list,
[data-theme="dark"] .block-list-item,
[data-theme="dark"] .block-definition-term,
[data-theme="dark"] .block-definition-text,
[data-theme="dark"] .block-example-title,
[data-theme="dark"] .block-example-step-content,
[data-theme="dark"] .block-example-step-label,
[data-theme="dark"] .block-callout-text,
[data-theme="dark"] .block-callout-label {
  color: var(--text-primary);
}

[data-theme="dark"] .block-example-step-label {
  color: var(--violet);
}

[data-theme="dark"] .block-paragraph code {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

[data-theme="dark"] .block-formula-box {
  background: var(--bg-secondary);
  border-color: var(--border);
}

[data-theme="dark"] .block-callout {
  border-color: var(--border);
}

[data-theme="dark"] .block-callout-tip {
  background: rgba(34, 197, 94, 0.08);
}

[data-theme="dark"] .block-callout-warning {
  background: rgba(245, 158, 11, 0.08);
}

[data-theme="dark"] .block-callout-important {
  background: rgba(239, 68, 68, 0.08);
}

[data-theme="dark"] .block-callout-note {
  background: rgba(108, 43, 255, 0.08);
}

[data-theme="dark"] .block-example {
  background: var(--bg-secondary);
  border-color: var(--border);
}

[data-theme="dark"] .block-table-th {
  background: var(--bg-secondary);
  border-color: var(--border);
  color: var(--text-primary);
}

[data-theme="dark"] .block-table-td {
  border-color: var(--border);
  color: var(--text-primary);
}

[data-theme="dark"] .block-image-placeholder {
  background: var(--bg-secondary);
  border-color: var(--border);
}

[data-theme="dark"] .block-image-caption {
  color: var(--text-secondary);
}

[data-theme="dark"] .block-definition {
  border-left-color: var(--violet);
}

/* ── Side widget legal links ── */
[data-theme="dark"] .learn-side-legal a {
  color: var(--text-secondary);
}

/* ── Area Header ── */
/* Area header has a colored bg (cyan, green etc.) — text stays white in dark mode */
[data-theme="dark"] .learn-area-title {
  color: #FFFFFF;
}

[data-theme="dark"] .learn-area-desc {
  color: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .learn-area-progress-track {
  background: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .learn-area-progress-fill {
  background: #FFFFFF !important;
}

[data-theme="dark"] .learn-area-pct {
  color: #FFFFFF;
}


/* ── Empty State ── */
[data-theme="dark"] .learn-empty-state p {
  color: var(--text-secondary);
}




/* ── Racha Fria / Streak Freeze ── */
.streak-dot.frozen {
  background: #E0F2FE;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

[data-theme="dark"] .streak-dot.frozen {
  background: #0C4A6E;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
}

.streak-cal-day.frozen-streak span {
  background: linear-gradient(135deg, #38BDF8, #0EA5E9);
  color: white;
  font-weight: 700;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* MVP: XP oculto hasta lanzamiento completo */
.module-xp-badge,
.module-reward-card,
.module-nav-xp,
[class*="xp"],
#nav-xp-reward,
#module-xp-badge,
#module-reward-xp {
  display: none !important;
}

/* Fix: eliminar tap highlight rectangular en móvil */
.skill-node,
.skill-node-circle,
.skill-node a {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.skill-node-circle:focus,
.skill-node-circle:focus-visible {
  outline: none;
}

/* ==========================================================================
   QUIZZES PAGE - Examen Skora module cards
   ========================================================================== */
.quizzes-page {
  --quiz-nav-bg: color-mix(in srgb, var(--bg-secondary) 78%, var(--bg-primary));
  --quiz-card-bg: var(--bg-white);
  --quiz-card-border: var(--border-subtle);
  --quiz-card-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  width: 100%;
}

.learn-tree-col.quizzes-workspace {
  overflow-y: auto;
  padding-right: 10px;
}

.quizzes-hero-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  min-height: 154px;
  padding: 18px 24px;
  overflow: hidden;
  border-radius: var(--r-2xl);
  background: var(--super-bg);
  color: var(--super-text-primary);
  box-shadow:
    0 16px 34px color-mix(in srgb, var(--super-bg) 42%, transparent),
    inset 0 0 0 1px var(--super-card-border);
}

.quizzes-hero-card::before {
  content: '';
  position: absolute;
  inset: -42% -10% auto 46%;
  height: 150%;
  background: var(--super-gradient);
  opacity: 0.36;
  filter: blur(34px);
  transform: rotate(-10deg);
  pointer-events: none;
}

.quizzes-hero-card::after {
  content: '';
  position: absolute;
  inset: auto -12% -60% 8%;
  height: 95%;
  background: var(--super-gradient);
  opacity: 0.14;
  filter: blur(44px);
  pointer-events: none;
}

.quizzes-hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  max-width: 560px;
  flex-direction: column;
  align-items: flex-start;
}

.quizzes-hero-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  margin-bottom: 8px;
  border: 1px solid color-mix(in srgb, var(--super-text-primary) 26%, transparent);
  border-radius: var(--r-full);
  background: var(--super-card-bg);
  color: var(--super-text-primary);
  font-size: 0.66rem;
  font-weight: var(--fw-bold);
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
}

.quizzes-hero-card h1 {
  margin: 0 0 6px;
  color: var(--super-text-primary);
  font-size: clamp(1.9rem, 2.35vw, 2.55rem);
  font-weight: var(--fw-extra);
  line-height: 1;
  letter-spacing: 0;
}

.quizzes-hero-card p {
  max-width: 520px;
  margin: 0;
  color: var(--super-text-secondary);
  font-size: 0.92rem;
  font-weight: var(--fw-semi);
  line-height: 1.35;
}

.quizzes-hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  margin-top: 12px;
  padding: 0 18px;
  border: none;
  border-radius: var(--r-full);
  background: var(--super-gradient);
  color: var(--super-text-primary);
  font-size: 0.8rem;
  font-weight: var(--fw-extra);
  letter-spacing: 0.2px;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(255, 60, 172, 0.3);
  transition: transform 140ms var(--super-ease-out), box-shadow 140ms var(--super-ease-out);
}

.quizzes-hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(255, 60, 172, 0.4);
}

.quizzes-hero-cta:active {
  transform: scale(0.97);
  box-shadow: 0 4px 16px rgba(255, 60, 172, 0.2);
}

.quizzes-hero-cta .material-symbols-outlined {
  font-size: 20px;
}

.quizzes-hero-visual {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 1;
  display: flex;
  width: 34%;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.quizzes-hero-icon {
  display: grid;
  width: min(170px, 80%);
  aspect-ratio: 1;
  place-items: center;
  opacity: 0.22;
  filter: drop-shadow(0 18px 42px rgba(255, 60, 172, 0.28));
  transform: rotate(-8deg);
}

.quizzes-hero-icon .material-symbols-outlined {
  color: var(--super-text-primary);
  font-size: clamp(108px, 10vw, 150px);
  font-variation-settings: 'FILL' 1, 'wght' 700, 'GRAD' 0, 'opsz' 48;
}

.quizzes-page .quizzes-topbar {
  padding-bottom: 0;
  margin-bottom: 0;
}

[data-theme="dark"] .quizzes-page {
  --quiz-nav-bg: color-mix(in srgb, var(--bg-elevated) 88%, var(--bg-white));
  --quiz-card-bg: color-mix(in srgb, var(--bg-white) 88%, var(--bg-primary));
  --quiz-card-border: color-mix(in srgb, var(--border-subtle) 82%, var(--bg-white));
}

.quizzes-subject-nav {
  position: sticky;
  top: 32px;
  width: 220px;
  padding: 10px;
  background: var(--quiz-nav-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.quizzes-subject-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-subject-pill {
  --subject-accent: var(--violet);
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 62px;
  padding: 10px 12px 10px 9px;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: background-color var(--duration) var(--ease), border-color var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.quiz-subject-pill:hover {
  background: color-mix(in srgb, var(--subject-accent) 9%, transparent);
}

.quiz-subject-pill.is-active {
  background: color-mix(in srgb, var(--subject-accent) 15%, transparent);
  border-left-color: var(--subject-accent);
  border-top-color: color-mix(in srgb, var(--subject-accent) 18%, transparent);
  border-right-color: color-mix(in srgb, var(--subject-accent) 18%, transparent);
  border-bottom-color: color-mix(in srgb, var(--subject-accent) 18%, transparent);
}

.quiz-subject-pill:focus-visible {
  outline: 2px solid var(--subject-accent);
  outline-offset: 2px;
}

.quiz-subject-pill--skeleton {
  pointer-events: none;
}

.quiz-subject-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--subject-accent) 12%, var(--bg-white));
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--subject-accent) 18%, transparent);
}

.quiz-subject-icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.quiz-subject-icon-fallback {
  color: var(--subject-accent);
  font-size: 24px;
}

.quiz-subject-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 3px;
}

.quiz-subject-copy strong {
  font-size: 0.92rem;
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quiz-subject-copy small {
  font-size: 0.74rem;
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  line-height: 1.25;
}

.quizzes-header {
  margin-bottom: 24px;
}

.quizzes-header h1 {
  margin: 0 0 8px;
  color: var(--text-primary);
  font-size: clamp(2rem, 3vw, 2.7rem);
  line-height: 1.05;
  font-weight: var(--fw-extra);
  letter-spacing: 0;
}

.quizzes-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.5;
  font-weight: var(--fw-medium);
}

.quiz-exam-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: stretch;
}

@media (min-width: 1360px) {
  .quiz-exam-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quiz-exam-grid>.quiz-exam-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

.quiz-exam-card {
  --subject-accent: var(--violet);
  position: relative;
  display: flex;
  min-height: 210px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 24px;
  background: var(--quiz-card-bg);
  border: 1px solid var(--quiz-card-border);
  border-radius: var(--r-lg);
  box-shadow: var(--quiz-card-shadow);
  color: var(--text-primary);
}

.quiz-exam-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--subject-accent);
}

.quiz-exam-card--available {
  box-shadow: var(--shadow-sm), 0 14px 32px color-mix(in srgb, var(--subject-accent) 14%, transparent);
}

.quiz-exam-card--skeleton {
  min-height: 210px;
  pointer-events: none;
}

.quiz-exam-card--skeleton::before {
  background: var(--border-subtle);
}

.quiz-exam-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.quiz-exam-kicker {
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: var(--fw-bold);
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0;
}

.quiz-exam-title {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(1.25rem, 1.6vw, 1.55rem);
  line-height: 1.18;
  font-weight: var(--fw-extra);
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.quiz-exam-meta {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.45;
  font-weight: var(--fw-medium);
}

.quiz-exam-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}

.quiz-state-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--subject-accent) 28%, transparent);
  border-radius: var(--r-full);
  font-size: 0.82rem;
  font-weight: var(--fw-bold);
  line-height: 1;
  white-space: nowrap;
}

.quiz-state-badge .material-symbols-outlined {
  font-size: 18px;
}

.quiz-state-badge--locked {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.quiz-state-badge--available {
  background: color-mix(in srgb, var(--subject-accent) 15%, transparent);
  color: var(--subject-accent);
}

.quiz-state-badge--completed {
  background: var(--green-light);
  color: var(--green);
}

.quiz-exam-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  max-width: 190px;
  padding: 0 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  font-size: 0.86rem;
  font-weight: var(--fw-bold);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), background-color var(--duration) var(--ease), border-color var(--duration) var(--ease);
}

.quiz-exam-action .material-symbols-outlined {
  font-size: 19px;
}

.quiz-exam-action:hover {
  transform: translateY(-1px);
}

.quiz-exam-action:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.quiz-exam-action--locked {
  background: transparent;
  color: var(--subject-accent);
  border-color: color-mix(in srgb, var(--subject-accent) 24%, var(--border-subtle));
}

.quiz-exam-action--locked:hover {
  background: var(--bg-hover);
}

.quiz-exam-action--available {
  background: var(--subject-accent);
  color: var(--text-inverse);
  border-color: transparent;
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--subject-accent) 72%, var(--text-primary));
}

[data-theme="dark"] .quiz-exam-action--available {
  color: var(--bg-primary);
}

.quiz-exam-action--completed {
  background: transparent;
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 36%, transparent);
}

.quiz-exam-action--completed:hover {
  background: var(--green-light);
}

.quiz-exams-empty {
  grid-column: 1 / -1;
  display: flex;
  min-height: 280px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  text-align: center;
  background: var(--quiz-card-bg);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--r-lg);
  color: var(--text-secondary);
}

.quiz-exams-empty .material-symbols-outlined {
  color: var(--violet);
  font-size: 42px;
  opacity: 0.65;
}

.quiz-exams-empty h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: var(--fw-extra);
  letter-spacing: 0;
}

.quiz-exams-empty p {
  max-width: 420px;
  margin: 0;
  line-height: 1.45;
}

.quiz-exams-empty--error .material-symbols-outlined {
  color: var(--red);
}

@media (max-width: 1120px) {
  .quizzes-subject-nav {
    position: static;
    width: 100%;
  }

  .quizzes-subject-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .quiz-exam-grid {
    grid-template-columns: 1fr;
  }
}