/* Premium CSS for System Architect Study Web App */

/* Root theme variables matching the Material Slate/Default styles */
:root {
  --quiz-correct-color: #2e7d32;
  --quiz-correct-bg: #e8f5e9;
  --quiz-incorrect-color: #c62828;
  --quiz-incorrect-bg: #ffebee;
  --quiz-border-color: #e0e0e0;
  --quiz-card-bg: #ffffff;
  --quiz-text-color: #212121;
}

[data-md-color-scheme="slate"] {
  --quiz-correct-color: #81c784;
  --quiz-correct-bg: #1b5e20;
  --quiz-incorrect-color: #e57373;
  --quiz-incorrect-bg: #b71c1c;
  --quiz-border-color: #37474f;
  --quiz-card-bg: #1e1e24;
  --quiz-text-color: #eceff1;
}

/* Quiz Container styling */
.quiz-container {
  border: 1.5px solid var(--quiz-border-color);
  background-color: var(--quiz-card-bg);
  border-radius: 12px;
  padding: 20px;
  margin: 24px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
  color: var(--quiz-text-color);
}

.quiz-container:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.quiz-question {
  font-weight: 700;
  font-size: 1.1em;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* Options buttons styling */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border: 1px solid var(--quiz-border-color);
  background-color: transparent;
  color: inherit;
  border-radius: 8px;
  font-size: 0.95em;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.quiz-option:hover:not(.correct):not(.incorrect):not(.disabled) {
  background-color: rgba(128, 128, 128, 0.08);
  border-color: var(--md-typeset-color);
}

/* Correct/Incorrect classes added via Javascript */
.quiz-option.correct {
  background-color: var(--quiz-correct-bg) !important;
  border-color: var(--quiz-correct-color) !important;
  color: var(--quiz-correct-color) !important;
  font-weight: bold;
}

.quiz-option.incorrect {
  background-color: var(--quiz-incorrect-bg) !important;
  border-color: var(--quiz-incorrect-color) !important;
  color: var(--quiz-incorrect-color) !important;
}

.quiz-option.disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Explanation styling */
.quiz-explanation {
  margin-top: 16px;
  padding: 14px;
  border-left: 4px solid var(--md-primary-fg-color, #007bff);
  background-color: rgba(128, 128, 128, 0.05);
  border-radius: 4px;
  font-size: 0.9em;
  line-height: 1.5;
  animation: fadeIn 0.4s ease-out;
}

/* Flashcard styling */
.flashcard-container {
  display: flex;
  justify-content: center;
  margin: 24px 0;
  perspective: 1000px;
}

.flashcard {
  width: 100%;
  max-width: 400px;
  height: 200px;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.flashcard.flipped {
  transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  border: 1px solid var(--quiz-border-color);
  background-color: var(--quiz-card-bg);
  color: var(--quiz-text-color);
}

.flashcard-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, rgba(128, 128, 128, 0.05), rgba(128, 128, 128, 0.02));
  border: 1.5px dashed var(--quiz-border-color);
}

.flashcard-badge {
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--md-primary-fg-color);
  margin-bottom: 12px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hide the default ugly MkDocs footer */
.md-footer {
  display: none !important;
}

/* Ensure page content doesn't get hidden behind the fixed thesis action bar */
.md-content {
  padding-bottom: 80px !important;
}

/* ── Thesis Bottom Action Bar ── */
.thesis-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: linear-gradient(
    90deg,
    rgba(20, 12, 40, 0.92) 0%,
    rgba(40, 24, 70, 0.88) 100%
  );
  border-top: 1px solid rgba(149, 117, 205, 0.25);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
  animation: slideUpBar 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUpBar {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Word count pills on the left */
.tbar-counts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tbar-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.tbar-pill-ok {
  background: rgba(46, 125, 50, 0.25);
  color: #81c784;
  border-color: rgba(129, 199, 132, 0.25);
}

.tbar-pill-warn {
  background: rgba(198, 40, 40, 0.22);
  color: #ef9a9a;
  border-color: rgba(239, 154, 154, 0.22);
}

/* Action buttons on the right */
.tbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.95em;          /* ↑ bigger */
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  text-decoration: none !important;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.2px;
  white-space: nowrap;
}

/* Play / Recite button */
.tbar-btn-play {
  background: linear-gradient(135deg, rgba(149, 117, 205, 0.28), rgba(103, 58, 183, 0.35));
  color: #e1bee7;
  border-color: rgba(149, 117, 205, 0.35);
}

.tbar-btn-play:hover {
  background: linear-gradient(135deg, rgba(149, 117, 205, 0.45), rgba(103, 58, 183, 0.5));
  border-color: rgba(149, 117, 205, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(103, 58, 183, 0.28);
}

/* Speaking / actively reading state */
.tbar-btn-speaking {
  background: linear-gradient(135deg, rgba(103, 58, 183, 0.65), rgba(149, 117, 205, 0.55)) !important;
  border-color: rgba(149, 117, 205, 0.85) !important;
  color: #fff !important;
  animation: speakingPulse 1.8s infinite alternate;
}

@keyframes speakingPulse {
  from { box-shadow: 0 0 6px rgba(149, 117, 205, 0.3); }
  to   { box-shadow: 0 0 20px rgba(149, 117, 205, 0.65); }
}

/* Podcast link button */
.tbar-btn-podcast {
  background: linear-gradient(135deg, rgba(244, 143, 177, 0.18), rgba(236, 64, 122, 0.22));
  color: #f48fb1;
  border-color: rgba(244, 143, 177, 0.28);
}

.tbar-btn-podcast:hover {
  background: linear-gradient(135deg, rgba(244, 143, 177, 0.35), rgba(236, 64, 122, 0.38));
  border-color: rgba(244, 143, 177, 0.55);
  color: #fce4ec;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(236, 64, 122, 0.22);
}

/* Drive Mode quick-link button in thesis bar */
.tbar-btn-drive {
  background: linear-gradient(135deg, rgba(255, 167, 38, 0.15), rgba(239, 108, 0, 0.18));
  color: #ffb74d;
  border-color: rgba(255, 167, 38, 0.25);
  padding: 10px 14px;          /* slightly narrower to fit 3 buttons */
}

.tbar-btn-drive:hover {
  background: linear-gradient(135deg, rgba(255, 167, 38, 0.32), rgba(239, 108, 0, 0.35));
  border-color: rgba(255, 167, 38, 0.5);
  color: #ffe082;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 167, 38, 0.2);
}

.tbar-btn-icon {
  font-size: 1.1em;
  line-height: 1;
}

/* ── Legacy .status-ok / .status-warn kept for quiz.js compatibility ── */
.status-warn {
  background-color: #ffebee;
  color: #c62828;
  font-size: 0.8em;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
}

[data-md-color-scheme="slate"] .status-warn {
  background-color: #b71c1c;
  color: #e57373;
}

.status-ok {
  background-color: #e8f5e9;
  color: #2e7d32;
  font-size: 0.8em;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
}

[data-md-color-scheme="slate"] .status-ok {
  background-color: #1b5e20;
  color: #81c784;
}

/* === MBTI Progress Tracker Styling === */

/* Progress Logger Panel */
.progress-logger-container {
  border: 1.5px dashed var(--quiz-border-color);
  background-color: rgba(128, 128, 128, 0.02);
  border-radius: 12px;
  padding: 20px;
  margin: 24px 0;
}

.mood-btn, .mastery-btn {
  border: 1px solid var(--quiz-border-color);
  background-color: var(--quiz-card-bg);
  color: inherit;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.2s ease;
}

.mood-btn:hover, .mastery-btn:hover {
  background-color: rgba(128, 128, 128, 0.08);
  border-color: var(--md-primary-fg-color);
}

/* Selected mood styles */
.mood-btn[data-mood="sunny"].selected {
  background-color: #ffe0b2 !important;
  border-color: #ffb74d !important;
  color: #e65100 !important;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(255, 183, 77, 0.2);
}
[data-md-color-scheme="slate"] .mood-btn[data-mood="sunny"].selected {
  background-color: #e65100 !important;
  border-color: #ffb74d !important;
  color: #ffe0b2 !important;
}

.mood-btn[data-mood="cloudy"].selected {
  background-color: #e8f5e9 !important;
  border-color: #81c784 !important;
  color: #2e7d32 !important;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(129, 199, 132, 0.2);
}
[data-md-color-scheme="slate"] .mood-btn[data-mood="cloudy"].selected {
  background-color: #1b5e20 !important;
  border-color: #81c784 !important;
  color: #e8f5e9 !important;
}

.mood-btn[data-mood="rainy"].selected {
  background-color: #e3f2fd !important;
  border-color: #64b5f6 !important;
  color: #1565c0 !important;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(100, 181, 246, 0.2);
}
[data-md-color-scheme="slate"] .mood-btn[data-mood="rainy"].selected {
  background-color: #0d47a1 !important;
  border-color: #64b5f6 !important;
  color: #e3f2fd !important;
}

.mastery-btn.selected {
  background-color: rgba(128, 128, 128, 0.1) !important;
  border-color: var(--md-primary-fg-color) !important;
  font-weight: bold;
  box-shadow: inset 0 0 4px rgba(0,0,0,0.1);
}

/* Card Gallery Layout */
.card-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.gallery-card {
  border: 1.5px solid var(--quiz-border-color);
  background-color: var(--quiz-card-bg);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  aspect-ratio: 1;
}

.gallery-card.locked {
  opacity: 0.3;
  border-style: dashed;
}

.gallery-card.unlocked {
  border-color: #ffd700;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.15);
  animation: pulseGold 2s infinite alternate;
}

.gallery-card-icon {
  font-size: 2.2em;
  margin-bottom: 8px;
}

.gallery-card-title {
  font-size: 0.85em;
  font-weight: bold;
  line-height: 1.2;
}

.gallery-card-day {
  font-size: 0.7em;
  opacity: 0.6;
  margin-top: 4px;
}

@keyframes pulseGold {
  from { box-shadow: 0 4px 12px rgba(255, 215, 0, 0.1); }
  to { box-shadow: 0 4px 20px rgba(255, 215, 0, 0.25); }
}

/* Mood Grid Layout */
.mood-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
  gap: 6px;
  margin: 20px 0;
}

.mood-grid-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  background-color: var(--quiz-border-color);
  border: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.mood-grid-cell:hover {
  transform: scale(1.2);
  z-index: 10;
}

.mood-grid-cell.sunny {
  background-color: #ffb74d !important;
}

.mood-grid-cell.cloudy {
  background-color: #81c784 !important;
}

.mood-grid-cell.rainy {
  background-color: #64b5f6 !important;
}

/* Tooltip for cells */
.mood-grid-cell::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 20;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.mood-grid-cell:hover::after {
  opacity: 1;
}

/* ==========================================================================
   Anti-AI-Slop Premium Navigation & UI Overrides (Hallmark Design Guidelines)
   ========================================================================== */

/* 1. Header & Navigation Glassmorphism Styling */
.md-header {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background-color: rgba(103, 58, 183, 0.85) !important; /* Deep Purple semi-transparent */
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

[data-md-color-scheme="slate"] .md-header {
  background-color: rgba(30, 30, 36, 0.8) !important; /* Slate theme dark semi-transparent */
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Sidebar navigation area */
.md-sidebar--navigation {
  background-color: rgba(255, 255, 255, 0.6) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.01);
}

[data-md-color-scheme="slate"] .md-sidebar--navigation {
  background-color: rgba(30, 30, 36, 0.5) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.02);
}

/* Sidebar table of contents */
.md-sidebar--toc {
  background-color: transparent !important;
}

/* 2. Sleek Menu Link Styling & Micro-interactions */
.md-nav__link {
  border-radius: 8px;
  padding: 8px 16px !important;
  margin: 4px 12px !important;
  font-weight: 550 !important; /* Hallmark refined font weight */
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  color: inherit;
}

/* Hover effect with subtle horizontal translation */
.md-nav__link:hover:not(.md-nav__link--active) {
  background-color: rgba(103, 58, 183, 0.08) !important;
  color: var(--md-primary-fg-color) !important;
  transform: translateX(4px);
}

[data-md-color-scheme="slate"] .md-nav__link:hover:not(.md-nav__link--active) {
  background-color: rgba(255, 255, 255, 0.05) !important;
  color: var(--md-primary-fg-color) !important;
}

/* Active/Selected menu item */
.md-nav__link--active {
  background-color: rgba(103, 58, 183, 0.12) !important;
  color: var(--md-primary-fg-color) !important;
  font-weight: 650 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(103, 58, 183, 0.2);
}

[data-md-color-scheme="slate"] .md-nav__link--active {
  background-color: rgba(149, 117, 205, 0.2) !important;
  border-color: rgba(149, 117, 205, 0.25);
}

/* 3. Section Title Styling */
.md-nav__caption {
  font-size: 0.75em !important;
  text-transform: uppercase !important;
  letter-spacing: 1.5px !important;
  font-weight: 700 !important;
  opacity: 0.8 !important;
  padding: 16px 20px 4px 20px !important;
  color: var(--md-primary-fg-color) !important;
}

/* 4. General Aesthetic Refinements */
.md-content {
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Rounded and sleek code blocks and quotes */
.md-typeset pre, .md-typeset code {
  border-radius: 8px !important;
}

.md-typeset blockquote {
  border-left: 4px solid var(--md-primary-fg-color) !important;
  background-color: rgba(103, 58, 183, 0.03) !important;
  border-radius: 0 8px 8px 0;
  padding: 12px 16px !important;
}

[data-md-color-scheme="slate"] .md-typeset blockquote {
  background-color: rgba(255, 255, 255, 0.02) !important;
}

/* ==========================================================================
   ISFP-T Magical Sidebar Visual Highlights (Tarot-Deck Navigation Entrances)
   ========================================================================== */

/* A glowing, stellar visual entry for "My Progress Gallery (成长手账)" */
.md-nav__link[href*="My_Progress_Gallery"] {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), rgba(103, 58, 183, 0.12)) !important;
  border: 1px solid rgba(255, 215, 0, 0.2) !important;
  color: #ffd700 !important;
  font-weight: 650 !important;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.05);
  animation: progressGlow 3s infinite alternate;
  margin-top: 10px !important;
  margin-bottom: 10px !important;
}

[data-md-color-scheme="slate"] .md-nav__link[href*="My_Progress_Gallery"] {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.12), rgba(149, 117, 205, 0.15)) !important;
  border-color: rgba(255, 215, 0, 0.25) !important;
  color: #ffe082 !important;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.08);
}

@keyframes progressGlow {
  from {
    box-shadow: 0 2px 6px rgba(255, 215, 0, 0.03);
    border-color: rgba(255, 215, 0, 0.15);
    transform: scale(1);
  }
  to {
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.35);
    transform: scale(1.01);
  }
}

/* A soft lavender starry visual entry for the active "Thesis & Podcast (论文与播客)" */
.md-nav__link[href*="Thesis"] {
  background: linear-gradient(135deg, rgba(149, 117, 205, 0.08), rgba(244, 143, 177, 0.08)) !important;
  border: 1.5px dashed rgba(149, 117, 205, 0.25) !important;
  color: #b39ddb !important;
  margin-top: 10px !important;
  margin-bottom: 10px !important;
}

[data-md-color-scheme="slate"] .md-nav__link[href*="Thesis"] {
  background: linear-gradient(135deg, rgba(149, 117, 205, 0.12), rgba(244, 143, 177, 0.12)) !important;
  border-color: rgba(149, 117, 205, 0.3) !important;
  color: #d1c4e9 !important;
}

/* ==========================================================================
   Dafu's Mood Feedback Bubble & Cozy Sticky Note Overrides
   ========================================================================== */

/* 1. Dafu's Mood Feedback Bubble */
.dafu-mood-bubble {
  margin-top: 16px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(149, 117, 205, 0.06), rgba(255, 248, 225, 0.12));
  border: 1px solid rgba(149, 117, 205, 0.15);
  border-radius: 12px;
  font-size: 0.9em;
  line-height: 1.6;
  color: var(--quiz-text-color);
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

[data-md-color-scheme="slate"] .dafu-mood-bubble {
  background: linear-gradient(135deg, rgba(149, 117, 205, 0.12), rgba(244, 143, 177, 0.1));
  border-color: rgba(149, 117, 205, 0.2);
}

/* 2. Dafu's Sticky Note Card (Home Page Widget) */
.dafu-note-card {
  margin: 24px 0;
  padding: 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 225, 0.85));
  border: 1px solid rgba(255, 215, 0, 0.25);
  color: #5d4037; /* Warm dark brown text for paper feel */
  box-shadow: 0 10px 25px rgba(255, 215, 0, 0.06), 0 3px 6px rgba(0, 0, 0, 0.02);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  animation: fadeIn 0.5s ease-out;
}

[data-md-color-scheme="slate"] .dafu-note-card {
  background: linear-gradient(135deg, rgba(30, 30, 36, 0.85), rgba(46, 37, 50, 0.8));
  border-color: rgba(149, 117, 205, 0.25);
  color: #e1bee7; /* Soft lavender for dark mode paper feel */
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.dafu-note-card:hover {
  transform: translateY(-2px) rotate(0.5deg);
  box-shadow: 0 12px 28px rgba(255, 215, 0, 0.1);
}

[data-md-color-scheme="slate"] .dafu-note-card:hover {
  box-shadow: 0 12px 28px rgba(149, 117, 205, 0.15);
}

.dafu-note-title {
  font-weight: 700;
  font-size: 0.95em;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  color: #ff8f00; /* Warm orange */
  border-bottom: 1px dashed rgba(255, 143, 0, 0.2);
  padding-bottom: 6px;
}

[data-md-color-scheme="slate"] .dafu-note-title {
  color: #ba68c8; /* Lavender violet */
  border-bottom-color: rgba(186, 104, 200, 0.2);
}

.dafu-note-content {
  font-size: 0.95em;
  line-height: 1.6;
}

.dafu-note-footer {
  margin-top: 12px;
  font-size: 0.75em;
  opacity: 0.6;
  text-align: right;
  font-style: italic;
}

/* ==========================================================================
   Continue-Learning Smart Navigator Widget
   ========================================================================== */

/* ── Quest Card outer shell ── */
.cl-widget {
  margin: 20px 0 24px;
  padding: 0;                  /* inner sections handle padding */
  border-radius: 20px;
  background: linear-gradient(
    145deg,
    rgba(30, 14, 60, 0.88) 0%,
    rgba(50, 22, 90, 0.80) 100%
  );
  border: 1px solid rgba(149, 117, 205, 0.28);
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: fadeIn 0.45s ease-out;
  overflow: hidden;
}

/* Quest card top banner */
.cl-quest-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: linear-gradient(90deg,
    rgba(103, 58, 183, 0.45) 0%,
    rgba(149, 117, 205, 0.3) 100%);
  border-bottom: 1px solid rgba(149, 117, 205, 0.2);
}

.cl-quest-label {
  font-size: 0.72em;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #ce93d8;
}

.cl-quest-star {
  font-size: 1em;
  animation: starSpin 4s linear infinite;
}

@keyframes starSpin {
  0%   { transform: rotate(0deg)   scale(1); }
  50%  { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Inner padding wrapper */
.cl-body {
  padding: 18px 20px 20px;
}

/* Header row: stats left, percent right */
.cl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cl-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cl-stat {
  font-size: 0.85em;
  color: rgba(225, 190, 231, 0.85);
}

.cl-stat strong {
  color: #ce93d8;
  font-size: 1.05em;
}

.cl-streak {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.8em;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 14px;
  background: rgba(255, 167, 38, 0.18);
  color: #ffb74d;
  border: 1px solid rgba(255, 167, 38, 0.25);
}

.cl-pct-label {
  font-size: 1.4em;
  font-weight: 800;
  color: #ce93d8;
  letter-spacing: -0.5px;
  line-height: 1;
}

/* Progress bar track */
.cl-progress-track {
  position: relative;
  height: 6px;
  border-radius: 6px;
  background: rgba(149, 117, 205, 0.12);
  overflow: visible;
  margin-bottom: 16px;
}

.cl-progress-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #9575cd, #ce93d8, #f48fb1);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Glowing dot at the tip of the fill */
.cl-progress-glow {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(206, 147, 216, 0.5), 0 0 10px rgba(206, 147, 216, 0.7);
  animation: glowPulse 2s infinite alternate;
  pointer-events: none;
}

@keyframes glowPulse {
  from { box-shadow: 0 0 4px 2px rgba(206, 147, 216, 0.4); }
  to   { box-shadow: 0 0 10px 4px rgba(206, 147, 216, 0.75); }
}

/* Dafu's message */
.cl-dafu-msg {
  font-size: 0.88em;
  color: rgba(225, 190, 231, 0.75);
  line-height: 1.55;
  margin-bottom: 14px;
  font-style: italic;
}

/* Chapter preview box (shown above CTA) */
.cl-chapter-preview {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(149, 117, 205, 0.15);
}

.cl-chapter-kw {
  font-size: 0.78em;
  color: rgba(225, 190, 231, 0.6);
  margin-bottom: 4px;
}

.cl-chapter-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.cl-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.75em;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(149, 117, 205, 0.12);
  color: #b39ddb;
  border: 1px solid rgba(149, 117, 205, 0.18);
}

/* ── Main CTA: Continue Button ── */
.cl-continue-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px 20px;
  border-radius: 14px;
  text-decoration: none !important;
  background: linear-gradient(
    135deg,
    rgba(103, 58, 183, 0.6) 0%,
    rgba(149, 117, 205, 0.5) 50%,
    rgba(244, 143, 177, 0.35) 100%
  );
  border: 1.5px solid rgba(149, 117, 205, 0.45);
  color: #f3e5f5 !important;
  font-weight: 700;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(103, 58, 183, 0.25),
              0 0 0 0 rgba(149, 117, 205, 0.4);
  animation: questPulse 3s ease-in-out infinite;
}

@keyframes questPulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(103, 58, 183, 0.25), 0 0 0 0 rgba(149, 117, 205, 0.4); }
  50%       { box-shadow: 0 6px 20px rgba(103, 58, 183, 0.35), 0 0 0 6px rgba(149, 117, 205, 0); }
}

.cl-continue-btn:hover {
  animation: none;  /* stop pulse on hover for crisp response */
}

/* Shimmer sweep animation */
.cl-continue-btn::before {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.08),
    transparent
  );
  animation: shimmerSweep 3s infinite;
}

@keyframes shimmerSweep {
  0%   { left: -60%; }
  100% { left: 160%; }
}

.cl-continue-btn:hover {
  background: linear-gradient(
    135deg,
    rgba(103, 58, 183, 0.75) 0%,
    rgba(149, 117, 205, 0.65) 50%,
    rgba(244, 143, 177, 0.45) 100%
  );
  border-color: rgba(206, 147, 216, 0.65);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(103, 58, 183, 0.35);
}

.cl-continue-icon {
  font-size: 1.6em;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(206, 147, 216, 0.5));
}

.cl-btn-text { flex: 1; }

.cl-btn-day {
  font-size: 0.78em;
  font-weight: 700;
  color: rgba(225, 190, 231, 0.7);
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.cl-btn-title {
  flex: 1;
  font-size: 0.9em;
  color: rgba(243, 229, 245, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cl-arrow {
  font-size: 1.2em;
  color: #f48fb1;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.cl-continue-btn:hover .cl-arrow {
  transform: translateX(4px);
}

/* Coming soon state */
.cl-coming-soon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px dashed rgba(149, 117, 205, 0.25);
  background: rgba(149, 117, 205, 0.04);
  color: rgba(225, 190, 231, 0.6);
  font-size: 0.88em;
}

.cl-badge-wip {
  font-size: 0.8em;
  padding: 3px 9px;
  border-radius: 10px;
  background: rgba(149, 117, 205, 0.12);
  color: #b39ddb;
  white-space: nowrap;
  flex-shrink: 0;
  font-style: italic;
}

