/* Operant Learner - Training Platform Styles */
/* Company Profile: Asteri Behavioral Treatment Center */

:root {
  --primary-color: #003876;
  --primary-dark: #002a5c;
  --primary-light: #0e488f;
  --secondary-color: #db8d03;
  --secondary-dark: #b87602;
  --secondary-light: #efc884;
  --accent-color: #db8d03;
  --danger-color: #ef4444;
  --success-color: #22c55e;
  --warning-color: #f59e0b;
  --text-primary: #1a2332;
  --text-secondary: #5a6577;
  --text-light: #8ca0b8;
  --bg-primary: #ffffff;
  --bg-secondary: #f7f8fa;
  --bg-tertiary: #e8ecf1;
  --border-color: #d4dae3;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --radius: 8px;
  --radius-lg: 12px;
}

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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
}

/* Header */
.header {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
  color: white;
  padding: 1rem 2rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: var(--primary-color);
  font-size: 1.2rem;
}

.logo-text h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

.logo-text span {
  font-size: 0.8rem;
  opacity: 0.9;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* My Trainings button in header */
.header-trainings-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.header-trainings-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Sidebar icon toolbar */
.sidebar-toolbar {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--bg-tertiary);
}
.sidebar-toolbar-btn {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.sidebar-toolbar-btn:hover {
  background: var(--bg-tertiary);
}
.sidebar-toolbar-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}
.sidebar-toolbar-btn svg {
  flex-shrink: 0;
}

/* Dropdown panels from toolbar buttons */
.sidebar-dropdown-panel {
  display: none;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  margin-bottom: 0.75rem;
  animation: sidebarDropIn 0.15s ease-out;
}
.sidebar-dropdown-panel.open {
  display: block;
}
@keyframes sidebarDropIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.sidebar-dropdown-panel .panel-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.15s;
}
.sidebar-dropdown-panel .panel-item:hover {
  background: var(--bg-secondary);
}
.sidebar-dropdown-panel .panel-item .panel-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* Schedule events inside calendar dropdown */
.sidebar-dropdown-panel .event-item {
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  margin-bottom: 0.3rem;
  border-left: 3px solid #3b82f6;
  background: var(--bg-secondary);
}
.sidebar-dropdown-panel .event-item:last-child {
  margin-bottom: 0;
}
.sidebar-dropdown-panel .event-title {
  font-weight: 600;
  font-size: 0.78rem;
  margin-bottom: 0.1rem;
}
.sidebar-dropdown-panel .event-detail {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.progress-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
}

/* Hamburger + Backdrop — hidden on desktop */
.sidebar-toggle {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

/* Main Container */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  padding-top: 80px; /* header height */
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  margin-top: 0.5rem;
}

.sidebar h2 {
  font-size: 1rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--bg-tertiary);
}

.sidebar-top {
  flex-shrink: 0;
}

.module-nav {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.module-nav-item {
  margin-bottom: 0.5rem;
}

.module-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s ease;
  cursor: pointer;
}

.module-nav-link:hover {
  background: var(--bg-secondary);
}

.module-nav-link.active {
  background: var(--primary-color);
  color: white;
}

.module-nav-link.completed {
  color: var(--secondary-color);
}

.module-nav-link.locked {
  color: var(--text-light);
  cursor: not-allowed;
}

.module-status {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.module-status.completed {
  background: var(--secondary-color);
  border-color: var(--secondary-color);
  color: white;
}

.module-status.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* Content Area */
.content-area {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow-y: auto;
  margin-top: 0.5rem;
  min-height: 0;
}

.content-header {
  background: linear-gradient(
    135deg,
    var(--bg-secondary) 0%,
    var(--bg-tertiary) 100%
  );
  padding: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.content-header h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.content-header .module-info {
  display: flex;
  gap: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.content-body {
  padding: 2rem;
}

/* Slide Content */
.slide-container {
  min-height: 400px;
}

.slide {
  display: none;
  animation: fadeIn 0.3s ease;
}

.slide.active {
  display: block;
}

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

.slide-number {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.slide h2 {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}

.slide h3 {
  font-size: 1.25rem;
  margin: 1.5rem 0 1rem;
  color: var(--text-primary);
}

.slide p {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.slide ul,
.slide ol {
  margin: 1rem 0 1rem 1.5rem;
}

.slide li {
  margin-bottom: 0.5rem;
}

/* Info Boxes */
.info-box {
  background: var(--bg-secondary);
  border-left: 4px solid var(--primary-color);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.info-box.tip {
  border-color: var(--secondary-color);
  background: #ecfdf5;
}

.info-box.warning {
  border-color: var(--warning-color);
  background: #fffbeb;
}

.info-box.important {
  border-color: var(--danger-color);
  background: #fef2f2;
}

.info-box-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Tables */
.table-container {
  overflow-x: auto;
  margin: 1.5rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
}

tr:hover {
  background: var(--bg-secondary);
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border-color);
}

.card-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-color);
  color: white;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.card h4 {
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ABC Model Visual */
.abc-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.abc-box {
  background: white;
  border: 2px solid var(--primary-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  min-width: 150px;
  box-shadow: var(--shadow);
}

.abc-box.highlight-a {
  border-color: #003876;
  background: #e8f0fe;
}
.abc-box.highlight-b {
  border-color: #db8d03;
  background: #fef3e2;
}
.abc-box.highlight-c {
  border-color: #10b981;
  background: #ecfdf5;
}

.abc-box h4 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.abc-arrow {
  font-size: 2rem;
  color: var(--text-light);
}

/* SEAT Visual */
.seat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.seat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 2px solid;
  box-shadow: var(--shadow);
}

.seat-card.sensory {
  border-color: #8b5cf6;
}
.seat-card.escape {
  border-color: #ef4444;
}
.seat-card.attention {
  border-color: #f59e0b;
}
.seat-card.tangible {
  border-color: #10b981;
}

.seat-letter {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.seat-card.sensory .seat-letter {
  color: #8b5cf6;
}
.seat-card.escape .seat-letter {
  color: #ef4444;
}
.seat-card.attention .seat-letter {
  color: #f59e0b;
}
.seat-card.tangible .seat-letter {
  color: #10b981;
}

/* Quiz Styles */
.quiz-container {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 1.5rem 0;
}

.quiz-question {
  margin-bottom: 2rem;
}

.quiz-question h4 {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.quiz-option:hover {
  border-color: var(--primary-color);
  background: #e8f0fe;
}

.quiz-option.selected {
  border-color: var(--primary-color);
  background: #e8f0fe;
}

.quiz-option.correct {
  border-color: var(--success-color);
  background: #ecfdf5;
}

.quiz-option.incorrect {
  border-color: var(--danger-color);
  background: #fef2f2;
}

.quiz-option input {
  display: none;
}

.quiz-radio {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.quiz-option.selected .quiz-radio {
  border-color: var(--primary-color);
}

.quiz-option.selected .quiz-radio::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  background: var(--primary-color);
  border-radius: 50%;
}

.quiz-feedback {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  display: none;
}

.quiz-feedback.show {
  display: block;
}

.quiz-feedback.correct {
  background: #ecfdf5;
  color: #166534;
  border: 1px solid #86efac;
}

.quiz-feedback.incorrect {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Navigation Controls */
.slide-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn.primary {
  background: var(--primary-color);
  color: white;
}

.nav-btn.primary:hover {
  background: var(--primary-dark);
}

.nav-btn.secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-btn.secondary:hover {
  background: var(--border-color);
}

.nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.progress-bar {
  flex: 1;
  max-width: 300px;
  margin: 0 2rem;
}

.progress-track {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 0.25rem;
}

/* Welcome Screen */
.welcome-screen {
  text-align: center;
  padding: 3rem;
}

.welcome-screen h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.welcome-screen .subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.welcome-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
  text-align: left;
}

.feature-card {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.feature-card h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.start-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1.125rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 1rem;
}

.start-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Module Complete Screen */
.module-complete {
  text-align: center;
  padding: 3rem;
}

.complete-icon {
  width: 80px;
  height: 80px;
  background: var(--secondary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 1.5rem;
}

.module-complete h2 {
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

.score-display {
  font-size: 3rem;
  font-weight: bold;
  color: var(--primary-color);
  margin: 1rem 0;
}

/* Final Assessment */
.final-assessment {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.assessment-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color);
}

.assessment-timer {
  font-size: 1.5rem;
  color: var(--primary-color);
  font-weight: bold;
}

.question-counter {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 900px) {
  /* Hamburger button */
  .sidebar-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-shrink: 0;
  }

  .sidebar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition:
      transform 0.3s ease,
      opacity 0.3s ease;
  }

  /* Animate hamburger → X when open */
  body.sidebar-open .sidebar-toggle span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  body.sidebar-open .sidebar-toggle span:nth-child(2) {
    opacity: 0;
  }
  body.sidebar-open .sidebar-toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  /* Header: keep row layout with hamburger */
  .header-content {
    flex-direction: row;
    gap: 0.5rem;
    text-align: left;
  }

  .header-content .logo-text h1 {
    font-size: 0.95rem;
  }

  .header-content .logo-text span {
    display: none;
  }

  .header-content .logo img,
  .header-content .logo div:first-child {
    height: 36px !important;
  }

  .progress-badge {
    display: none;
  }

  /* My Trainings button — icon only on mobile */
  .header-trainings-btn span {
    display: none;
  }
  .header-trainings-btn {
    padding: 0.4rem;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    justify-content: center;
  }

  /* Main layout */
  .main-container {
    grid-template-columns: 1fr;
    height: auto;
    padding: 0.75rem;
    padding-top: 70px;
    gap: 0;
  }

  /* Sidebar as slide-out drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    z-index: 1060;
    border-radius: 0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 70px 1rem 1.5rem;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  /* Backdrop overlay */
  .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  /* Prevent body scroll when sidebar open */
  body.sidebar-open {
    overflow: hidden;
  }

  /* Content tweaks */
  .abc-visual {
    flex-direction: column;
  }

  .abc-arrow {
    transform: rotate(90deg);
  }

  .seat-grid {
    grid-template-columns: 1fr;
  }

  /* Slide navigation fits mobile */
  .slide-navigation {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .slide-navigation .nav-btn {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
  }

  .content-header h1 {
    font-size: 1.1rem;
  }
}

/* ==================== Narration Audio Player ==================== */

.narration-player {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  margin: 0.5rem 0;
  background: linear-gradient(135deg, #0a1628, #132240);
  border-radius: 10px;
  color: #d4dae3;
  font-size: 0.8125rem;
  user-select: none;
}

.narration-player .np-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #003876;
  color: white;
  cursor: pointer;
  font-size: 0.875rem;
  flex-shrink: 0;
  transition: background 0.15s;
}

.narration-player .np-btn:hover {
  background: #0e488f;
}

.narration-player .np-btn.mute-btn {
  background: transparent;
  color: #8ca7d0;
  width: 28px;
  height: 28px;
}

.narration-player .np-btn.mute-btn:hover {
  color: white;
}

.narration-player .np-btn.mute-btn.muted {
  color: #ef4444;
}

.narration-progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.narration-progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.narration-progress-fill {
  height: 100%;
  background: #db8d03;
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}

.narration-time {
  font-size: 0.75rem;
  color: #8ca7d0;
  white-space: nowrap;
  min-width: 70px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.narration-speed {
  font-size: 0.6875rem;
  padding: 0.2rem 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: #8ca7d0;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}

.narration-speed:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.narration-auto-label {
  font-size: 0.6875rem;
  color: #5a6577;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  cursor: pointer;
}

.narration-auto-label input[type="checkbox"] {
  accent-color: #003876;
}

/* Audio Lock - No-seek progress bar */
.narration-progress-bar.narration-no-seek {
  cursor: not-allowed;
  opacity: 0.7;
}

/* Audio Lock Notice */
.audio-lock-notice {
  text-align: center;
  font-size: 0.75rem;
  color: #8ca7d0;
  padding: 0.25rem 0;
}

/* Tap-to-Play Notice (autoplay blocked — Safari) */
.tap-to-play-notice {
  text-align: center;
  font-size: 0.75rem;
  color: #f59e0b;
  padding: 0.25rem 0;
  animation: tapPulse 2s ease-in-out infinite;
}

/* Pulsing Play Button (autoplay blocked) */
.narration-tap-to-play {
  animation: tapPulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
  border-radius: 50%;
}

@keyframes tapPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Audio Fallback Notice (audio failed after retries) */
.audio-fallback-notice {
  text-align: center;
  font-size: 0.75rem;
  color: #f59e0b;
  padding: 0.25rem 0;
}

/* Slide Sub-Navigation (expandable slide list under modules) */
.module-nav-link .module-expand-arrow {
  margin-left: auto;
  font-size: 0.65rem;
  transition: transform 0.2s ease;
  color: var(--text-light);
  flex-shrink: 0;
}

.module-nav-link .module-expand-arrow.expanded {
  transform: rotate(90deg);
}

.slide-sub-nav {
  list-style: none;
  padding: 0;
  margin: 0 0 0 1.5rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.slide-sub-nav.expanded {
  max-height: 2000px;
}

.slide-nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
  line-height: 1.3;
}

.slide-nav-item:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.slide-nav-item.active {
  background: rgba(0, 56, 118, 0.08);
  color: var(--primary-color);
  font-weight: 600;
}

.slide-nav-item.completed {
  color: var(--text-secondary);
}

.slide-nav-item.locked {
  color: var(--text-light);
  cursor: not-allowed;
  opacity: 0.5;
}

.slide-nav-item.locked:hover {
  background: transparent;
  color: var(--text-light);
}

.slide-nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--border-color);
}

.slide-nav-item.active .slide-nav-dot {
  background: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 56, 118, 0.2);
}

.slide-nav-item.completed .slide-nav-dot {
  background: var(--secondary-color);
}

.slide-nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

/* Print Styles */
@media print {
  .header,
  .sidebar,
  .slide-navigation {
    display: none;
  }

  .main-container {
    display: block;
    margin: 0;
    padding: 0;
  }

  .content-area {
    box-shadow: none;
  }
}

/* ============================================================
   Audio-synced slide animations
   ------------------------------------------------------------
   Elements in slide content can opt into audio-synced reveals:

     <div data-cue="5.2"> … </div>            reveals when audio
                                              currentTime >= 5.2s
     <div data-progress> … </div>             gets a CSS variable
                                              --cue-progress (0..1)
                                              updated each timeupdate

   Base styles below define the default hidden/visible states so
   every author doesn't have to redefine them. Slide-specific
   <style> blocks can override for custom motion.
   ============================================================ */
[data-cue] {
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
}
[data-cue].cue-visible {
  opacity: 1;
  transform: translateY(0);
}
/* Progress-driven elements: author uses var(--cue-progress) in
   inline styles. Default starting value is 0 so pre-audio state
   renders cleanly on load. */
[data-progress] {
  --cue-progress: 0;
}
