/**
 * Docuplay Manifest Audio Karaoke Player Styles
 * Designed for High-Impact Executive Presentation & Immersive Reading
 */

/* ==========================================================================
   1. FLOATING STICKY DOCK PLAYER (BOTTOM)
   ========================================================================== */
.docu-manifest-dock {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 900px;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.docu-dock-container {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.94) 0%, rgba(30, 41, 59, 0.96) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  padding: 14px 20px;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: #ffffff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.docu-dock-container:hover {
  box-shadow: 0 24px 50px -8px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   2. LIVE SUBTITLE TICKER
   ========================================================================== */
.docu-dock-ticker {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 28px;
}

.docu-ticker-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
  flex-shrink: 0;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.docu-ticker-pulse.playing {
  background: #22c55e;
  box-shadow: 0 0 12px #22c55e;
  animation: docu-pulse 1.6s infinite;
}

@keyframes docu-pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.docu-ticker-text {
  font-size: 13.5px;
  font-weight: 500;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}

/* Ticker Spoken Word Highlighting */
.docu-ticker-word {
  display: inline-block;
  transition: color 0.1s ease, transform 0.1s ease;
  padding: 0 1px;
}

.docu-ticker-word.docu-ticker-word-speaking {
  color: #ef4444 !important; /* Vibrant Red in dock */
  font-weight: 800 !important;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
  transform: scale(1.08);
}

/* ==========================================================================
   3. CONTROLS BAR
   ========================================================================== */
.docu-dock-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.docu-dock-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
}

.docu-btn-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: none;
  color: #ffffff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

.docu-btn-play:hover {
  transform: scale(1.08);
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.6);
}

.docu-btn-play:active {
  transform: scale(0.96);
}

.docu-dock-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docu-dock-title {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.3px;
}

.docu-dock-time {
  font-size: 11px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  font-family: monospace;
}

/* Center Scrubber */
.docu-dock-center {
  flex: 1;
  padding: 0 10px;
}

.docu-progress-container {
  width: 100%;
  height: 22px;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.docu-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  transition: height 0.15s ease;
}

.docu-progress-container:hover .docu-progress-track {
  height: 8px;
}

.docu-progress-buffered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.docu-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8 0%, #3b82f6 100%);
  border-radius: 3px;
  position: relative;
}

.docu-progress-thumb {
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.docu-progress-container:hover .docu-progress-thumb {
  opacity: 1;
}

/* Right Controls */
.docu-dock-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.docu-dock-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.docu-dock-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.docu-dock-btn.active {
  background: rgba(59, 130, 246, 0.3);
  border-color: #3b82f6;
  color: #60a5fa;
}

/* Volume Wrap */
.docu-volume-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 2px 8px 2px 2px;
}

.docu-volume-slider {
  width: 60px;
  height: 4px;
  accent-color: #38bdf8;
  cursor: pointer;
}

/* Mini Collapsed Badge */
.docu-dock-mini-badge {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  padding: 10px 18px;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  font-weight: 600;
  font-size: 13px;
  transition: all 0.25s ease;
}

.docu-dock-mini-badge:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.5);
}

/* ==========================================================================
   4. IN-PAGE CONTENT BLOCK HIGHLIGHTING & INTERACTIVITY
   ========================================================================== */
.docu-karaoke-block {
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, padding 0.25s ease;
  border-left: 4px solid transparent;
  cursor: pointer;
  border-radius: 6px;
}

.docu-karaoke-block:hover {
  background-color: rgba(254, 240, 138, 0.2) !important;
  border-left-color: rgba(234, 179, 8, 0.4) !important;
}

/* Active Paragraph/Heading (Amber Halo Context Framing) */
.docu-karaoke-block.docu-karaoke-block-active {
  background-color: rgba(254, 240, 138, 0.42) !important;
  border-left: 5px solid #eab308 !important;
  box-shadow: 0 4px 18px rgba(234, 179, 8, 0.22) !important;
  padding-left: 14px !important;
}

/* Active Quote Box */
.docu-quote-box.docu-karaoke-block-active {
  background: #fef9c3 !important;
  border-left: 5px solid #eab308 !important;
  box-shadow: 0 6px 20px rgba(234, 179, 8, 0.25) !important;
}

/* ==========================================================================
   5. WORD-BY-WORD POP & CRIMSON ILLUMINATION (THE STAR EFFECT)
   ========================================================================== */
.docu-karaoke-word {
  display: inline-block;
  position: relative;
  border-radius: 3px;
  padding: 0 1.5px;
  margin: 0 -0.5px;
  cursor: pointer;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1),
              color 0.12s ease,
              background-color 0.12s ease,
              text-shadow 0.12s ease,
              box-shadow 0.12s ease;
  will-change: transform, color;
}

.docu-karaoke-word:hover {
  text-decoration: underline;
  text-decoration-color: #dc2626;
  text-underline-offset: 3px;
}

/* The precise word spoken at this millisecond */
.docu-karaoke-word.docu-karaoke-word-speaking {
  color: #dc2626 !important; /* Crimson Red */
  font-weight: 800 !important;
  transform: scale(1.18) translateY(-1.5px);
  text-shadow: 0 0 14px rgba(220, 38, 38, 0.45), 0 0 1px rgba(220, 38, 38, 0.85);
  background-color: rgba(254, 226, 226, 0.85) !important; /* Rose halo */
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3) !important;
  z-index: 10;
}

/* Previously spoken words in active block */
.docu-karaoke-block.docu-karaoke-block-active .docu-karaoke-word.docu-karaoke-word-past {
  color: #0f172a; /* Sharp contrast */
}


/* ==========================================================================
   6. TABLE OF CONTENTS (INDEX) - PREMIUM CARD GRID
   ========================================================================== */
.docu-toc-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 28px 32px;
  margin-bottom: 40px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.docu-toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.docu-toc-title {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 !important;
  border: none !important;
  padding: 0 !important;
}

.docu-toc-title svg {
  color: #1e3a8a;
  flex-shrink: 0;
}

.docu-toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.docu-toc-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  transition: all 0.2s ease;
  list-style: none !important;
  margin: 0 !important;
}

.docu-toc-item:hover {
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}

.docu-toc-item a {
  font-weight: 600;
  color: #1e3a8a !important;
  text-decoration: none !important;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.35;
}

.docu-toc-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  background: #dbeafe;
  color: #1e40af;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ==========================================================================
   7. RESPONSIVE ADJUSTMENTS
   ========================================================================== */
@media (max-width: 768px) {
  .docu-toc-card {
    padding: 18px 14px;
  }
  .docu-toc-grid {
    grid-template-columns: 1fr;
  }
@media (max-width: 768px) {
  .docu-manifest-dock {
    bottom: 12px;
    width: calc(100% - 20px);
  }
  .docu-dock-container {
    padding: 10px 14px;
    border-radius: 14px;
  }
  .docu-dock-controls {
    flex-wrap: wrap;
    gap: 8px;
  }
  .docu-dock-left {
    min-width: auto;
  }
  .docu-dock-title {
    display: none;
  }
  .docu-dock-center {
    order: 3;
    width: 100%;
    padding: 0;
  }
  .docu-volume-wrap {
    display: none;
  }
  .docu-btn-label {
    display: none;
  }
  .docu-karaoke-word.docu-karaoke-word-speaking {
    transform: scale(1.12) translateY(-1px);
  }
}
