/**
 * Interactive Video Player - Standalone CSS
 * Complete styling for the interactive video player
 * No build process required
 */

/* === Base Player Styles === */
/* Outer player container; sets background, size, and base font */
.ivp-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100%;
  background: var(--player-bg-light); /* Very light blue instead of black */
  border-radius: 0; /* Remove border radius for full-width layout */
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Ensure consistent box-sizing inside the player - Universal box-sizing reset */
.ivp-container * {
  box-sizing: border-box;
}

/* Wrapper around video + controls + overlays */
.ivp-player-wrapper {
  position: relative;
  width: 100%;
  background: var(--player-bg-light); /* Very light blue instead of black */
}

/* 16:9 video box (letterboxed); becomes absolute in fullscreen */
.ivp-video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: var(--player-bg-light); /* Very light blue instead of black */
}

/* The <video> element; scaled to fit (contain) */
.ivp-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center; /* ensure centered letterboxing */
}

/* Controls bar overlay at bottom of the player */
.ivp-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  padding: 10px;
  background: linear-gradient(to top, var(--player-controls-gradient-start), var(--player-controls-gradient-end));
  z-index: 10;
  transition: opacity 0.3s ease;
  opacity: 1;
  pointer-events: all;
}

/* Hidden state for auto-hide behavior - Controls fade out after inactivity */
.ivp-controls-hidden {
  opacity: 0;
  pointer-events: none;
}

/* Show controls on hover only when NOT in fullscreen */
.ivp-container:not(:fullscreen) .ivp-player-wrapper:hover .ivp-controls,
.ivp-container:not(:-webkit-full-screen) .ivp-player-wrapper:hover .ivp-controls {
  opacity: 1;
  pointer-events: all;
}

/* Left and right clusters of control buttons */
.ivp-controls-left,
.ivp-controls-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Center cluster (holds progress bar) */
.ivp-controls-center {
  flex: 1;
  margin: 0 15px;
}

/* Shared styles for individual control buttons */
.ivp-control-button {
  background: none;
  border: none;
  color: var(--player-controls-text);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

/* Subtle hover feedback on control buttons */
.ivp-control-button:hover {
  opacity: 0.8;
}

/* Icon size for control buttons */
.ivp-control-button svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Elapsed/Duration time display next to play button */
.ivp-time-display {
  color: var(--player-controls-text);
  font-size: 13px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 500;
  user-select: none;
  white-space: nowrap;
  min-width: 42px; /* Prevents flickering for times like "1:02" vs "11:02" */
  text-align: left;
}

/* Wrapper for the progress bar area */
.ivp-progress-container {
  position: relative;
  width: 100%;
  padding: 10px 0;
}

/* Seek bar track (background) */
.ivp-progress-bar {
  position: relative;
  width: 100%;
  height: 4px;
  background: var(--player-progress-track);
  border-radius: 2px;
  cursor: pointer;
  transition: height 0.2s;
}

/* Slightly thicken track on hover */
.ivp-progress-bar:hover {
  height: 6px;
}

/* Filled portion of the seek bar indicating current time */
.ivp-progress-filled {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--ivp-accent, #2196F3);
  border-radius: 2px;
  transition: width 0.1s;
}

/* Draggable handle shown on hover/scrub */
.ivp-progress-handle {
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: var(--player-progress-handle);
  border-radius: 50%;
  box-shadow: 0 2px 4px var(--player-progress-handle-shadow);
  opacity: 0;
  transition: opacity 0.2s;
}

/* Reveal the handle when hovering or scrubbing */
.ivp-progress-bar:hover .ivp-progress-handle,
.ivp-progress-bar.ivp-scrubbing .ivp-progress-handle {
  opacity: 1;
}

/* Scrubbing state styles */
.ivp-progress-bar.ivp-scrubbing {
  height: 8px !important;
  cursor: grabbing;
}

/* Enlarge the handle during scrubbing */
.ivp-progress-bar.ivp-scrubbing .ivp-progress-handle {
  transform: translateY(-50%) scale(1.2);
  box-shadow: 0 2px 8px var(--player-progress-handle-shadow-active);
}

/* Disable fill animation during scrubbing */
.ivp-progress-bar.ivp-scrubbing .ivp-progress-filled {
  transition: none; /* Disable animation during scrubbing */
}

/* Floating thumbnail preview above the progress bar */
.ivp-thumbnail-preview {
  position: absolute;
  left: 0;
  top: -100px;
  width: 160px;
  height: 90px;
  background-color: var(--player-thumbnail-bg);
  background-size: auto;
  background-repeat: no-repeat;
  border-radius: 4px;
  box-shadow: 0 6px 20px var(--player-thumbnail-shadow);
  border: 1px solid var(--player-thumbnail-border);
  pointer-events: none;
  z-index: 20;
}

/* Small dot markers on the progress bar indicating interactions */
.ivp-progress-bar .ivp-interaction-marker {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: var(--player-marker-color);
  border-radius: 50%;
  z-index: 5;
  transition: transform 0.2s;
  pointer-events: none;
}

/* Enlarge interaction markers on hover */
.ivp-progress-bar:hover .ivp-interaction-marker {
  transform: translateY(-50%) scale(1.5);
}

/* Volume button + popup slider wrapper */
.ivp-volume-container {
  position: relative;
  display: flex;
  align-items: center;
}

/* Popup card that holds the vertical volume slider */
.ivp-volume-slider-container {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 10px;
  background: var(--player-volume-popup-bg);
  border-radius: 6px;
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  width: 40px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px var(--player-volume-popup-shadow);
}

/* Reveal the volume slider popup on hover */
.ivp-volume-container:hover .ivp-volume-slider-container {
  opacity: 1;
  visibility: visible;
}

/* Vertical range input used for volume level */
.ivp-volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 6px;
  background: transparent;
  outline: none;
  cursor: pointer;
  transform: rotate(-90deg);
  transform-origin: center;
  position: relative;
}

/* Remove blue highlight on focus - Clean volume slider appearance */
.ivp-volume-slider:focus {
  outline: none;
}

/* Webkit browsers (Chrome, Safari) track/thumb styling */
.ivp-volume-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  background: var(--player-volume-track);
  border-radius: 3px;
  cursor: pointer;
}

/* Webkit thumb for the volume slider */
.ivp-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--player-volume-thumb);
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  top: 50%;
  transform: translateY(-50%);
  box-shadow: 0 1px 3px var(--player-volume-thumb-shadow);
}

/* Firefox track/thumb styling for volume slider */
.ivp-volume-slider::-moz-range-track {
  width: 100%;
  height: 6px;
  background: var(--player-volume-track);
  border-radius: 3px;
  cursor: pointer;
}

/* Firefox thumb for the volume slider */
.ivp-volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--player-volume-thumb);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  position: relative;
  box-shadow: 0 1px 3px var(--player-volume-thumb-shadow);
}

/* Remove Firefox focus styles */
.ivp-volume-slider::-moz-focus-inner {
  border: 0;
}

.ivp-volume-slider::-moz-focus-outer {
  border: 0;
}

/* Centered loading spinner wrapper */
.ivp-loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
}

/* The animated spinner circle */
.ivp-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--player-spinner-track);
  border-top-color: var(--player-spinner-active);
  border-radius: 50%;
  animation: ivp-spin 1s linear infinite;
}

/* Rotation animation for spinner */
@keyframes ivp-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Error message container shown over the video */
.ivp-error-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--player-controls-text);
  padding: 20px;
}

/* Error icon visuals */
.ivp-error-icon svg {
  width: 48px;
  height: 48px;
  fill: var(--player-error-icon);
  margin-bottom: 10px;
}

/* Error message text */
.ivp-error-text {
  margin: 0;
  font-size: 14px;
}

/* Root dark theme surface color for the player - Dark mode background */
.ivp-theme-dark {
  background: var(--player-theme-dark-bg);
}

/* Root light theme surface color for the player - Light mode background */
.ivp-theme-light {
  background: var(--player-theme-light-bg);
}


/* Wrapper for the replay/settings toggle in controls */
.ivp-replay-toggle-container {
  position: relative;
  display: flex;
  align-items: center;
}

/* The settings gear-style button - Toggles replay options menu */
.ivp-replay-toggle {
  position: relative;
}

/* Active state color for the settings toggle - Blue when menu is open */
.ivp-replay-toggle[aria-pressed="true"] {
  color: var(--ivp-accent, #2196F3);
}

/* Dropdown menu for replay + re-answer settings */
.ivp-replay-menu {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 10px;
  background: var(--settings-menu-bg);
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--settings-menu-shadow);
  padding: 8px 0;
  min-width: 200px;
  z-index: 10000;
  display: none;
}

/* Little caret pointer under the dropdown - Triangle pointing to settings button */
.ivp-replay-menu::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 16px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--settings-menu-caret);
}

/* Row item inside the replay dropdown */
.ivp-menu-item {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.2s;
  gap: 8px;
}

/* Hover feedback for dropdown items */
.ivp-menu-item:hover {
  background-color: var(--settings-menu-item-hover);
}

/* Checkbox styling alignment inside dropdown - Native checkbox appearance */
.ivp-menu-item input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

/* Dropdown item label */
.ivp-menu-item span {
  color: var(--settings-menu-item-text);
  font-size: 14px;
  user-select: none;
}

/* Dark theme styling for the replay dropdown */
.ivp-theme-dark .ivp-replay-menu {
  background: var(--settings-menu-bg-dark);
  box-shadow: 0 4px 12px var(--settings-menu-shadow-dark);
}

/* Dark theme caret color for the dropdown */
.ivp-theme-dark .ivp-replay-menu::after {
  border-top-color: var(--settings-menu-caret-dark);
}

/* Dark theme hover color for dropdown rows */
.ivp-theme-dark .ivp-menu-item:hover {
  background-color: var(--settings-menu-item-hover-dark);
}

/* Dark theme text color for dropdown labels */
.ivp-theme-dark .ivp-menu-item span {
  color: var(--player-controls-text);
}

/* Keep controls dark even in light theme by using base .ivp-controls styles */

/* === Interaction Styles === */
/* Fullscreen overlay covering the video; centers the card and sets overall top gap */
.ivp-interaction-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--quiz-overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 25px;
  opacity: 0;
  animation: ivp-fade-in 0.3s forwards;
  /* Upward bias: reduce top gap between player top and card top */
  --ivp-card-offset: clamp(8px, 4vh, 32px); /* increase middle (vh) to push card higher */
}

/* Fade-in animation for overlay */
@keyframes ivp-fade-in {
  to {
    opacity: 1;
  }
}

/* The white question card container (hint band is positioned relative to this) */
.ivp-interaction-card {
  position: relative;
  background: var(--quiz-card-bg-main);
  border-radius: 12px;
  box-shadow: 0 10px 40px var(--quiz-card-shadow-main);
  max-width: 800px;
  width: 100%;
  /* Allow externally anchored feedback band without shifting the card */
  overflow: visible;
  animation: ivp-scale-in 0.3s ease-out;
  /* Nudge the card upward slightly (ties hint band too since it’s positioned relative to this card) */
  margin-top: calc(-1 * var(--ivp-card-offset));
}

@keyframes ivp-scale-in {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Close/skip button at the top-right of the question card - X button to dismiss quiz */
.ivp-skip-button {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: var(--quiz-skip-color);
  font-size: 28px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s, color 0.2s;
  z-index: 10;
}

/* Hover feedback for the skip button */
.ivp-skip-button:hover {
  background-color: var(--quiz-skip-hover-bg);
  color: var(--quiz-skip-hover-color);
}

/* Scrollable inner area of the card - Contains question and answer options */
.ivp-card-body {
  /* Scrollable content region for question + options */
  max-height: calc(90vh - 120px); /* leave room for feedback band */
  overflow: auto;
}

/* Spacing wrapper around the question; bottom padding = gap to options */
.ivp-question-container {
  padding: 12px 20px 6px;
}

/* Actual question text styling */
.ivp-question-text {
  margin: 0;
  font-size: 14px;
  font-weight: normal;
  color: var(--quiz-option-text-main);
  line-height: 1.4;
}

/* Container around the options grid; top padding = gap from question; gap = space between option buttons */
.ivp-options-container {
  padding: 16px 20px 24px;
  display: grid;
  gap: 12px;
}

/* Grid layout when 2 options are shown */
.ivp-options-2 {
  grid-template-columns: repeat(2, 1fr);
}

/* Grid layout when 3 options are shown */
.ivp-options-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Grid layout when 4 options are shown */
.ivp-options-4 {
  grid-template-columns: repeat(2, 1fr);
}

/* Individual answer button visuals and paddings - Clickable quiz answer choices */
.ivp-option-button {
  background: var(--quiz-option-bg-main);
  border: 2px solid var(--quiz-option-border-main);
  border-radius: 6px;
  padding: 16px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
  color: var(--quiz-option-text-main);
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: flex-start; /* Left align content */
  text-align: left;            /* Left align multi-line text */
  position: relative;
  overflow: hidden;
}

.ivp-option-button:hover:not(:disabled):not(.selected) {
  background: var(--quiz-option-hover-bg-main);
  border-color: var(--quiz-option-hover-border-main);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--quiz-option-hover-shadow-main);
}

.ivp-option-button:active:not(:disabled):not(.selected) {
  transform: translateY(0);
  box-shadow: 0 2px 6px var(--quiz-option-active-shadow-main);
}

.ivp-option-button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* Selected state (before submission) - Golden/Yellow styling */
.ivp-option-button.selected {
  background-color: var(--quiz-option-selected-bg-main);
  border-width: 3px;
  border-style: solid;
  border-color: var(--quiz-option-selected-border-main);
  color: var(--quiz-option-selected-text-main);
  transform: scale(0.98);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Selected hover state */
.ivp-option-button.selected:hover:not(:disabled) {
  background-color: var(--quiz-option-selected-hover-bg-main);
  border-width: 3px;
  border-style: solid;
  border-color: var(--quiz-option-selected-border-main);
  color: var(--quiz-option-selected-text-main);
  transform: scale(0.98);
}

/* Selected active state */
.ivp-option-button.selected:active:not(:disabled) {
  background-color: var(--quiz-option-selected-bg-main);
  border-width: 3px;
  border-style: solid;
  border-color: var(--quiz-option-selected-border-main);
  color: var(--quiz-option-selected-text-main);
  transform: scale(0.95);
}

/* Correct answer state - Green styling for right answers */
.ivp-option-button.ivp-correct {
  background: var(--quiz-correct-bg-main);
  border-color: var(--quiz-correct-border-main);
  color: var(--quiz-correct-text-main);
  animation: ivp-pulse-correct 0.5s ease;
}

/* Incorrect answer state - Red styling for wrong answers */
.ivp-option-button.ivp-incorrect {
  background: var(--quiz-incorrect-bg-main);
  border-color: var(--quiz-incorrect-border-main);
  color: var(--quiz-incorrect-text-main);
  animation: ivp-shake 0.5s ease;
}

@keyframes ivp-pulse-correct {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes ivp-shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

/* Image content inside answer options - Scales to fit button */
.ivp-option-image {
  max-width: 100%;
  max-height: 150px;
  object-fit: contain;
}

/* Feedback/hint band anchored below the card; reserves right space for the CTA button */
.ivp-feedback-container {
  /* Anchor outside and below the card to avoid layout shift */
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  padding: 16px 20px;
  border-top: 1px solid var(--quiz-feedback-border-main);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  animation: ivp-slide-up 0.25s ease-out;
  /* Make the container the positioning context for the CTA */
  /* Use block layout and reserve space on the right for the CTA column */
  display: block;
  padding-right: calc(var(--ivp-feedback-actions-min, 220px) + var(--ivp-feedback-safe-gap, 16px));
  border-radius: 12px; /* round all four corners of the hint container */
  box-shadow: 0 8px 24px var(--quiz-feedback-shadow-main);
}

@keyframes ivp-slide-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ivp-feedback-correct {
  color: var(--quiz-feedback-correct-text-main);
  background: var(--quiz-feedback-correct-bg-main);
}

.ivp-feedback-incorrect {
  color: var(--quiz-feedback-incorrect-text-main);
  background: var(--quiz-feedback-incorrect-bg-main);
}

.ivp-theme-dark .ivp-interaction-card {
  background: var(--quiz-card-bg-dark-main);
}

.ivp-theme-dark .ivp-question-text {
  color: var(--player-controls-text);
}

.ivp-theme-dark .ivp-option-button {
  background: var(--quiz-option-bg-dark-main);
  border-color: var(--quiz-option-border-dark-main);
  color: var(--player-controls-text);
}

/* Ensure selected states stay visible in dark theme (mild colors) */
.ivp-theme-dark .ivp-option-button.ivp-incorrect {
  background: var(--quiz-incorrect-bg-dark-main);  /* mild red */
  border-color: var(--quiz-incorrect-border-dark-main);
  color: var(--player-controls-text);
}

.ivp-theme-dark .ivp-option-button.ivp-correct {
  background: var(--quiz-correct-bg-dark-main);  /* mild green */
  border-color: var(--quiz-correct-border-dark-main);
  color: var(--quiz-correct-text-dark-main);       /* readable on light green */
}

.ivp-theme-dark .ivp-option-button:hover:not(:disabled) {
  background: var(--quiz-option-hover-bg-dark-main);
  border-color: var(--quiz-option-hover-border-dark-main);
}

.ivp-theme-dark .ivp-feedback-container {
  border-top-color: var(--quiz-feedback-border-dark-main);
}

.ivp-theme-dark .ivp-skip-button {
  color: var(--quiz-skip-color-dark-main);
}

.ivp-theme-dark .ivp-skip-button:hover {
  background-color: var(--quiz-skip-hover-bg-dark-main);
  color: var(--player-controls-text);
}

/* Text inside the feedback band - Main hint/explanation content */
.ivp-feedback-text {
  margin: 0;
  line-height: 1.35;
  white-space: pre-line;
  flex: 0 1 auto;
  max-width: 100%; /* allow text to use full available space */
  word-wrap: break-word;
}

.ivp-feedback-container .ivp-next-button,
.ivp-feedback-container .ivp-try-again-button {
  margin: 0;
  white-space: nowrap;
  align-self: flex-start;
}

/* CTA (Next/Try Again) wrapper; absolute positioned inside the feedback band */
.ivp-feedback-actions {
  /* Vertically center the CTA button for all feedback lengths */
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 30px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  min-width: var(--ivp-feedback-actions-min, 220px);
  margin: 0;
  padding: 0;
  height: auto;
}

@media (max-width: 720px) {
  /* Clean layout maintained */
}

@media (max-width: 520px) {
  .ivp-feedback-container {
    /* Stack on small screens */
    display: flex;
    flex-direction: column;
    text-align: center;
    gap: 12px;
    padding-right: 20px; /* remove reserved CTA space */
  }
  .ivp-feedback-actions {
    position: static;      /* let it flow under the text */
    min-width: unset;
    justify-content: center;
    margin-top: 8px;
  }
}

/* Base button styling for both Next and Try Again in the feedback band - Action buttons */
.ivp-next-button,
.ivp-try-again-button {
  background: var(--ivp-accent, #2196F3);
  color: var(--text-white);
  border: none;
  border-radius: 50px;
  padding: 10px 24px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.ivp-next-button:hover,
.ivp-try-again-button:hover {
  background: color-mix(in oklab, var(--ivp-accent, #2196F3) 85%, var(--color-black, black));
  transform: translateY(-1px);
}

.ivp-next-button:active,
.ivp-try-again-button:active {
  transform: translateY(0);
}

.ivp-feedback-correct .ivp-next-button {
  background: var(--btn-success-main); /* success green for correct answers */
}

.ivp-feedback-correct .ivp-next-button:hover {
  background: var(--btn-success-hover-main); /* darker green on hover */
}

/* Remove generic dark-theme overrides to respect specific states */

/* Mild red styling specifically for Try Again button (overrides theme defaults) */
.ivp-try-again-button {
  background: var(--btn-error-main); /* mild red */
}
.ivp-try-again-button:hover {
  background: var(--btn-error-hover-main);
}
.ivp-try-again-button:active {
  background: var(--btn-error-active-main);
}
.ivp-theme-dark .ivp-try-again-button {
  background: var(--btn-error-main);
}
.ivp-theme-dark .ivp-try-again-button:hover {
  background: var(--btn-error-hover-main);
}
.ivp-theme-dark .ivp-try-again-button:active {
  background: var(--btn-error-active-main);
}

/* Replay mode indicator - Shows when question is being re-answered */
.ivp-replay-indicator {
  margin-top: 10px;
  font-size: 14px;
  color: var(--replay-indicator-main);
  font-style: italic;
}

.ivp-theme-dark .ivp-replay-indicator {
  color: var(--replay-indicator-dark-main);
}

.ivp-interaction-card.ivp-replaying {
  border: 2px solid var(--replay-border-main);
}

.ivp-theme-dark .ivp-interaction-card.ivp-replaying {
  border-color: var(--replay-border-dark-main);
}

.ivp-previously-selected {
  position: relative;
  overflow: visible;
}

.ivp-previously-selected::after {
  content: '✓';
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: var(--replay-marker-main);
  color: var(--text-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 2px 4px var(--replay-marker-shadow-main);
}

.ivp-previously-selected.ivp-correct::after {
  background: var(--replay-marker-correct-main);
}

.ivp-previously-selected.ivp-incorrect::after {
  content: '✗';
  background: var(--replay-marker-incorrect-main);
}

/* === Responsive Styles === */
@media (max-width: 768px) {
  .ivp-interaction-overlay { --ivp-card-offset: clamp(12px, 6vh, 48px); }
  .ivp-controls {
    padding: 8px;
  }
  
  .ivp-control-button {
    padding: 6px;
  }
  
  .ivp-control-button svg {
    width: 20px;
    height: 20px;
  }
  
  .ivp-time-display {
    font-size: 12px;
    min-width: 38px; /* Smaller for tablet */
  }
  
  .ivp-controls-center {
    margin: 0 10px;
  }
  
  .ivp-volume-container:hover .ivp-volume-slider {
    width: 60px;
  }
  
  .ivp-interaction-card {
    max-width: 95%;
    margin: 10px;
  }
  
  .ivp-question-container {
    padding: 20px;
  }
  
  .ivp-question-text {
    font-size: 20px;
  }
  
  /* Container around the options grid; top padding = gap from question; gap = space between option buttons (tablet) */
  .ivp-options-container {
    padding: 15px 20px 20px;
    gap: 10px;
  }
  
  .ivp-options-2,
  .ivp-options-3,
  .ivp-options-4 {
    grid-template-columns: 1fr;
  }
  
  .ivp-option-button {
    padding: 15px;
    font-size: 15px;
    min-height: 60px;
  }
  
  .ivp-option-image {
    max-height: 120px;
  }
  
  .ivp-feedback-container {
    padding: 15px 20px;
    font-size: 14px;
  }
  
  .ivp-skip-button {
    top: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .ivp-container {
    border-radius: 0;
  }
  
  .ivp-controls {
    padding: 6px;
  }
  
  .ivp-control-button {
    padding: 4px;
  }
  
  .ivp-control-button svg {
    width: 18px;
    height: 18px;
  }
  
  .ivp-time-display {
    font-size: 11px;
    min-width: 34px; /* Smaller for mobile */
  }
  
  .ivp-progress-bar {
    height: 3px;
  }
  
  .ivp-progress-bar:hover {
    height: 5px;
  }
  
  .ivp-volume-container .ivp-volume-slider {
    display: none;
  }
  
  .ivp-interaction-overlay {
    padding: 10px;
  }
  
  .ivp-interaction-card {
    border-radius: 8px;
  }
  
  .ivp-question-container {
    padding: 15px;
  }
  
  .ivp-question-text {
    font-size: 18px;
  }
  
  /* Container around the options grid on mobile; top padding = gap from question; gap = space between option buttons */
  .ivp-options-container {
    padding: 10px 15px 15px;
    gap: 8px;
  }
  
  .ivp-option-button {
    padding: 12px;
    font-size: 14px;
    min-height: 50px;
  }
  
  .ivp-option-image {
    max-height: 100px;
  }
  
  .ivp-feedback-container {
    padding: 12px 15px;
    font-size: 13px;
  }
}

@media (hover: none) and (pointer: coarse) {
  .ivp-volume-container .ivp-volume-slider {
    width: 60px;
    opacity: 1;
  }
  
  .ivp-progress-handle {
    opacity: 1;
  }
  
  .ivp-option-button:hover {
    transform: none;
    box-shadow: none;
  }
  
  .ivp-option-button:active:not(:disabled) {
    transform: scale(0.95);
  }
}

@media (orientation: landscape) and (max-height: 480px) {
  .ivp-interaction-overlay { --ivp-card-offset: clamp(8px, 4vh, 32px); }
  .ivp-interaction-card {
    max-height: 85vh;
  }
  
  .ivp-question-container {
    padding: 15px 20px 10px;
  }
  
  .ivp-question-text {
    font-size: 18px;
  }
  
  /* Container around the options grid for short landscape view; top padding = gap from question; gap = space between option buttons */
  .ivp-options-container {
    padding: 10px 20px 15px;
    gap: 8px;
  }
  
  .ivp-option-button {
    padding: 10px;
    min-height: 45px;
    font-size: 14px;
  }
  
  .ivp-option-image {
    max-height: 80px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ivp-interaction-overlay,
  .ivp-interaction-card,
  .ivp-option-button,
  .ivp-feedback-container {
    animation: none;
    transition: none;
  }
  
  .ivp-option-button.ivp-correct,
  .ivp-option-button.ivp-incorrect {
    animation: none;
  }
  
  .ivp-controls {
    transition: none;
  }
}

@media print {
  .ivp-controls,
  .ivp-interaction-overlay {
    display: none;
  }
  
  .ivp-video-container {
    position: static;
    padding-bottom: 0;
  }
  
  .ivp-video {
    position: static;
    height: auto;
  }
}

/* === Fullscreen layout: center video with letterboxing === */
.ivp-container:fullscreen,
.ivp-container:-webkit-full-screen {
  width: 100%;
  height: 100%;
}

.ivp-container:fullscreen .ivp-player-wrapper,
.ivp-container:-webkit-full-screen .ivp-player-wrapper {
  width: 100%;
  height: 100%;
}

.ivp-container:fullscreen .ivp-video-container,
.ivp-container:-webkit-full-screen .ivp-video-container {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding-bottom: 0; /* override 16:9 box in fullscreen */
}

.ivp-container:fullscreen .ivp-video,
.ivp-container:-webkit-full-screen .ivp-video {
  width: 100%;
  height: 100%;
  object-fit: contain;      /* maintain aspect */
  object-position: center;  /* center both axes */
}

/* Hide cursor in fullscreen when requested */
.ivp-container:fullscreen.ivp-hide-cursor,
.ivp-container:-webkit-full-screen.ivp-hide-cursor,
.ivp-container:fullscreen.ivp-hide-cursor *,
.ivp-container:-webkit-full-screen.ivp-hide-cursor * {
  cursor: none !important;
}

/* Course layout styles moved to css/course.css to avoid cross-component overrides */

/* ========================================
   Schema v2.0: New Component Styles
   ======================================== */

/* Submit button */
.ivp-submit-button {
    display: block;
    margin: 0 auto 20px;
    padding: 10px 24px;
    background: var(--color-surface, #3e8bc8);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
}

.ivp-submit-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ivp-submit-button:not(:disabled):hover {
    background: var(--color-border, #2c6ba0);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Question progress indicator */
.ivp-question-progress {
    text-align: center;
    margin-bottom: 12px;
    padding: 6px 8px;
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
}

.ivp-progress-text {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Schema v2.0 Button states */
.ivp-option-button.correct-selected {
    background: #4caf50 !important;
    color: white !important;
    border-color: #4caf50 !important;
}

.ivp-option-button.incorrect-selected {
    background: #f44336 !important;
    color: white !important;
    border-color: #f44336 !important;
}

.ivp-option-button.correct-unselected {
    border: 2px solid #4caf50 !important;
    background: rgba(76, 175, 80, 0.1) !important;
}

.ivp-option-button.partial-selected {
    background: #ff9800 !important;
    color: white !important;
    border-color: #ff9800 !important;
}

/* Multiple choice indicator */
.ivp-options-container.ivp-question-multiple .ivp-option-button {
    position: relative;
}

.ivp-options-container.ivp-question-multiple .ivp-option-button::before {
    content: '☐';
    margin-right: 8px;
    font-size: 18px;
}

.ivp-options-container.ivp-question-multiple .ivp-option-button.selected::before {
    content: '☑';
}

/* Question header for progress */
.ivp-question-header {
    margin-bottom: 0px;
}
