/**
 * Volume Slider Fixes for Goodnight eNight
 * 
 * This file ensures the volume slider is properly displayed in all modes:
 * - Main View (story-mode-view)
 * - AI Edit Mode (story-mode-editable)
 * - Night Mode (story-mode-night)
 * - Print Mode (story-mode-printable)
 */

/* ===== Global Volume Slider Fixes ===== */
/* These target all modes with high specificity */

/* Input slider direct targeting with highest specificity */
html body input.volume-slider[type="range"],
html body.single-story-view input.volume-slider[type="range"],
input.volume-slider[type="range"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  background: white !important;
  border-radius: 3px !important;
  height: 6px !important;
  width: 100% !important;
  outline: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: 0 0 5px rgba(255, 255, 255, 1) !important;
  opacity: 1 !important;
  z-index: 10 !important;
  position: relative !important;
}

/* Override any parent container that might be setting transparent */
html body .volume-slider,
html body.single-story-view .volume-slider,
.volume-slider {
  background: none !important;
  max-width: 150px !important;
  opacity: 1 !important;
  z-index: 1 !important;
  position: relative !important;
  flex: 1 !important;
  height: 24px !important;
}

/* Track styles */
html body input.volume-slider[type="range"]::-webkit-slider-runnable-track,
input.volume-slider[type="range"]::-webkit-slider-runnable-track {
  width: 100% !important;
  height: 6px !important;
  background: white !important;
  border-radius: 3px !important;
  border: none !important;
  box-shadow: 0 0 5px rgba(255, 255, 255, 1) !important;
}

html body input.volume-slider[type="range"]::-moz-range-track,
input.volume-slider[type="range"]::-moz-range-track {
  width: 100% !important;
  height: 6px !important;
  background: white !important;
  border-radius: 3px !important;
  border: none !important;
  box-shadow: 0 0 5px rgba(255, 255, 255, 1) !important;
}

/* Thumb styles */
html body input.volume-slider[type="range"]::-webkit-slider-thumb,
input.volume-slider[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 15px !important;
  height: 15px !important;
  background: white !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  margin-top: -4.5px !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.5) !important;
}

html body input.volume-slider[type="range"]::-moz-range-thumb,
input.volume-slider[type="range"]::-moz-range-thumb {
  width: 15px !important;
  height: 15px !important;
  background: white !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.5) !important;
}

/* Create container background using pseudo-element */
.audio-volume-control {
  position: relative !important;
  background: transparent !important;
  display: flex !important;
  align-items: center !important;
  margin-top: 5px !important;
  gap: 8px !important;
}

.audio-volume-control:before {
  content: "" !important;
  position: absolute !important;
  top: 50% !important;
  left: 24px !important;
  right: 0 !important;
  height: 6px !important;
  background: white !important;
  border-radius: 3px !important;
  transform: translateY(-50%) !important;
  z-index: 0 !important;
  box-shadow: 0 0 5px rgba(255, 255, 255, 1) !important;
  pointer-events: none !important;
}

/* ===== Mode-Specific Overrides ===== */

/* AI Edit Mode */
html body.single-story-view.story-mode-editable input.volume-slider[type="range"],
body.single-story-view.story-mode-editable input.volume-slider[type="range"],
body.story-mode-editable input.volume-slider[type="range"] {
  background: white !important;
  box-shadow: 0 0 5px rgba(255, 255, 255, 1) !important;
}

html body.single-story-view.story-mode-editable .audio-volume-control:before,
body.single-story-view.story-mode-editable .audio-volume-control:before {
  background: white !important;
  box-shadow: 0 0 5px rgba(255, 255, 255, 1) !important;
}

/* Night Mode */
html body.single-story-view.story-mode-night input.volume-slider[type="range"],
body.single-story-view.story-mode-night input.volume-slider[type="range"],
body.story-mode-night input.volume-slider[type="range"] {
  background: white !important;
  box-shadow: 0 0 5px rgba(255, 255, 255, 1) !important;
}

html body.single-story-view.story-mode-night .audio-volume-control:before,
body.single-story-view.story-mode-night .audio-volume-control:before {
  background: white !important;
  box-shadow: 0 0 5px rgba(255, 255, 255, 1) !important;
}

/* Print Mode */
html body.single-story-view.story-mode-printable input.volume-slider[type="range"],
body.single-story-view.story-mode-printable input.volume-slider[type="range"],
body.story-mode-printable input.volume-slider[type="range"] {
  background: white !important;
  box-shadow: 0 0 5px rgba(255, 255, 255, 1) !important;
}

html body.single-story-view.story-mode-printable .audio-volume-control:before,
body.single-story-view.story-mode-printable .audio-volume-control:before {
  background: white !important;
  box-shadow: 0 0 5px rgba(255, 255, 255, 1) !important;
} 