* {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
}

body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Arial, sans-serif;
  background-color: #f3f4f6;
}

#videoContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #f3f4f6;
  height: 100vh;
  width: 100vw;
}

.header {
  display: flex;
  width: 100%;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  padding: 12px;
}

.heading4 {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #181818;
  line-height: 1.4;
}

.video-frame {
  flex: 1;
  height: 60%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  width: -webkit-fill-available;
  border-bottom: 1px solid #e5e7eb;
  padding: 12px;
}

.video {
  height: fit-content;
  width: fit-content;
  border-radius: 8px;
  overflow: hidden;
  max-width: 100%;
  max-height: 100%;
  flex: 1;
  display: none;
}

video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.footer {
  display: flex;
  width: 100%;
  padding: 12px;
}

.controls {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
}

.controls img {
  cursor: pointer;
  width: 15px;
  height: 15px;
}

.progress-bar {
  position: relative;
  width: 100%;
  height: 0.25rem;
  background-color: #d1d5db;
  border-radius: 0.25rem;
}

#slider {
  flex: 1;
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  background: #d3d3d3;
  border-radius: 4px;
  outline: none;
  margin: 0;
  padding: 0;
  position: relative;
  cursor: pointer;
}

#slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  background: white;
  border: 4px solid #b11226;
  height: 18px;
  width: 18px;
  cursor: pointer;
  border-radius: 50%;
  position: relative;
  top: 2px;
  transform: translateY(-3px);
}

#slider::-moz-range-thumb {
  background: white;
  border: 4px solid #b11226;
  height: 18px;
  width: 18px;
  cursor: pointer;
  border-radius: 50%;
}

.time {
  font-size: 13px;
  color: #6b7280;
  font-weight: 600;
  font-family: Arial;
}

.time .current-time {
  color: #b11226;
}

#overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  transition: background 200ms ease;
}

.overlay--buffering {
  background: rgba(0, 0, 0, 0.5);
}

.loader {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  /* width driven by content — no max-width cap that creates empty space */
  width: max-content;
  background: #ffffff;
  padding: 9px 13px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

#loader {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
}

#loader img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.message {
  display: flex;
  flex-direction: column;
  gap: 1px;
  white-space: nowrap;
}

.title {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: #b11226;
  letter-spacing: 0;
  margin: 0;
}

.subTitle {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  color: #6b7280;
  margin: 0;
}

.buffer-pct {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: #b11226;
  font-variant-numeric: tabular-nums;
  min-width: 3ch;
  margin: 0;
}

.hidden {
  display: none !important;
}

#playPauseButton:focus-visible,
#slider:focus-visible,
#retryButton:focus-visible {
  outline: 2px solid #b11226;
  outline-offset: 2px;
}

#retryButton {
  margin-top: 6px;
  padding: 4px 10px;
  background: #b11226;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
}

#retryButton:hover {
  background: #8e0e1e;
}

/* Autoplay-blocked affordance — reuses the existing overlay card with a cursor prompt */
.overlay--autoplay-blocked {
  cursor: pointer;
}

.overlay--autoplay-blocked .title {
  cursor: pointer;
}

/* Network status banner — non-blocking toast anchored to the bottom of the player */
#network-status-banner {
  position: fixed;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #ffffff;
  border-left: 3px solid #b11226;
  color: #181818;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 200;
}

#network-status-banner.network-banner--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  /* Suppress the spinner gif — replace with a static tinted box */
  #loader img {
    display: none;
  }

  #loader::after {
    content: '';
    display: block;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: #b11226;
    opacity: 0.25;
  }

  /* Disable the overlay background fade transition */
  #overlay {
    transition: none;
  }

  /* Disable the network banner slide/fade animation */
  #network-status-banner {
    transition: none;
    transform: translateX(-50%) translateY(0);
  }
}
