/*
 * Harvester ProSlab IQ Introduction — preview.css
 *
 * Thin layout layer on top of:
 *   /css/fireflystyles.css         (brand, dark mode, lesson sidebar, progress bar)
 *   /css/progress-components.css   (progress UI components)
 *
 * Add ONLY rules that change layout/spacing for this standalone preview.
 * Brand colors, dark mode, typography, and component skins all come from
 * fireflystyles.css and inherit automatically.
 */

/* Top bar — no utility nav in standalone, give the navbar a touch more breathing room */
body.proslabiq-preview-page .navbar {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

body.proslabiq-preview-page .navbar-logo {
  height: 36px;
  width: auto;
}

/* Close gap between navbar and lesson progress bar.
   fireflystyles.css sets body.lesson-page .lesson-progress-container { top: 84px }
   (56px LMS navbar + 34px spacing). Preview navbar uses 0.75rem vertical padding and a
   36px logo — match sticky offset to that height so the bars stack flush. */
body.proslabiq-preview-page.lesson-page .navbar.sticky-top {
  margin-bottom: 0 !important;
}

body.proslabiq-preview-page.lesson-page .lesson-progress-container {
  top: calc(0.75rem + 0.75rem + 36px) !important;
  margin-top: 0 !important;
}

@media (max-width: 768px) {
  body.proslabiq-preview-page.lesson-page .lesson-progress-container {
    top: calc(0.75rem + 0.75rem + 36px) !important;
  }
}

/* Override the LMS .navbar-brand { order: 1 !important; } rule from
   fireflystyles.css line 301. The LMS intentionally puts the brand on the
   right next to the utility nav; on these standalone preview pages we want
   the brand on the left (the only thing in the navbar besides the toggle). */
body.proslabiq-preview-page .navbar-brand {
  order: 0 !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
}

body.proslabiq-preview-page .preview-navbar-inner {
  display: flex !important;
  align-items: center;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
}

/* iOS-style dark/light toggle switch
   On  = dark mode (checkbox checked, brand-yellow track, thumb right)
   Off = light mode (checkbox unchecked, translucent track, thumb left)
   theme-preference.js syncs the checked state with localStorage automatically. */
.preview-darkmode-switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  margin: 0;
  padding: 4px;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
}

.preview-darkmode-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.preview-darkmode-track {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.preview-darkmode-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s ease, background 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.preview-darkmode-switch input[type="checkbox"]:checked + .preview-darkmode-track {
  background: #ffe803;
}

.preview-darkmode-switch input[type="checkbox"]:checked + .preview-darkmode-track .preview-darkmode-thumb {
  transform: translateX(22px);
}

.preview-darkmode-switch input[type="checkbox"]:focus-visible + .preview-darkmode-track {
  outline: 2px solid #ffe803;
  outline-offset: 2px;
}

.preview-darkmode-switch:hover .preview-darkmode-track {
  background: rgba(255, 255, 255, 0.4);
}

.preview-darkmode-switch:hover input[type="checkbox"]:checked + .preview-darkmode-track {
  background: #fff033;
}

/* Video placeholder shown when wistiaId is empty in LESSONS — clear visual cue
   for the editor that this lesson still needs a video ID assigned. */
.video-placeholder {
  display: none;
  aspect-ratio: 16 / 9;
  width: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.75rem;
  background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
  color: #cccccc;
  border: 2px dashed #555555;
  border-radius: 12px;
  text-align: center;
  padding: 2rem;
}

.video-placeholder strong {
  color: #ffe803;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.video-placeholder code {
  background: rgba(255, 232, 3, 0.12);
  color: #ffe803;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.95em;
}

body:not(.dark-mode) .video-placeholder {
  background: linear-gradient(135deg, #f5f5f7 0%, #e8e8eb 100%);
  color: #444;
  border-color: #c0c0c5;
}

body:not(.dark-mode) .video-placeholder strong {
  color: #b8860b;
}

body:not(.dark-mode) .video-placeholder code {
  background: rgba(184, 134, 11, 0.12);
  color: #6f5510;
}

/* Completion toast (shown after the final lesson auto-completes) */
.completion-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #005cb9;
  color: #ffffff;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  z-index: 1080;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

body.dark-mode .completion-toast {
  background: #0a84ff;
}

/* Completed-state colors (sidebar items, progress steps, check icons) all
   inherit from fireflystyles.css. The LMS uses blue (#005cb9) for completed
   step indicators and a green-tinted background + yellow image border for
   completed sidebar items. No overrides needed — let those styles apply. */

/* Completed sidebar checkmark — match the brand green (#34c759) used elsewhere
   in fireflystyles for the completed border accent. */
.lesson-item.completed .lesson-check .check-icon {
  color: #34c759;
}

body.dark-mode .lesson-item.completed .lesson-check .check-icon {
  color: #34c759;
}

/* Locked sidebar lock-icon — slightly dimmer to match the muted lesson state */
.lesson-item.locked .lesson-check .lock-icon {
  color: #999999;
  opacity: 0.7;
}

body.dark-mode .lesson-item.locked .lesson-check .lock-icon {
  color: #777777;
}

/* Kicker row: kicker on the left, Download Quick Guide button on the right.
   Mirrors the AMP-L100 / AMP How-To lesson masthead layout from
   fireflystyles.css line 11261-11279, but scoped to our standalone preview
   body class so we don't touch the LMS rules. */
body.proslabiq-preview-page .lesson-masthead__kicker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

body.proslabiq-preview-page .lesson-masthead__kicker-row .howto__kicker {
  margin-bottom: 0 !important;
}

body.proslabiq-preview-page .lesson-masthead__kicker-row .lesson-cheat-sheet-btn {
  flex-shrink: 0;
  margin-bottom: 0;
  white-space: nowrap;
}

body.proslabiq-preview-page .lesson-masthead .intro-title {
  margin-top: 0.5rem !important;
}

/* Mobile: stack the layout, hide sidebar duration to save space, keep top progress bar */
@media (max-width: 991.98px) {
  body.proslabiq-preview-page .lesson-page-main {
    margin-top: 1rem;
  }
}

/* Tablet/desktop content max-width tweak so reading column doesn't get too wide */
@media (min-width: 1200px) {
  body.proslabiq-preview-page .lesson-article {
    max-width: 720px;
  }
}
