/* Modern, Edge-to-Edge Responsive HLS Player Stylesheet */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #000000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #ffffff;
  user-select: none;
  -webkit-user-select: none;
}

#player-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  background-color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#player-container.controls-hidden {
  cursor: none;
}

#player-container.controls-hidden .overlay-bar,
#player-container.controls-hidden #center-play-btn {
  opacity: 0;
  pointer-events: none;
}

#video-player {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  background-color: #000000;
}

/* Spinner Overlay */
.spinner-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 5;
}

.spinner {
  width: 54px;
  height: 54px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ef4444;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Center Play Button */
.center-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(15, 17, 23, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 6;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.center-btn:hover {
  transform: translate(-50%, -50%) scale(1.1);
  background: rgba(239, 68, 68, 0.9);
  border-color: #ef4444;
}

/* Overlay Bars Common */
.overlay-bar {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 18px 24px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}


/* Bottom Bar */
.bottom-bar {
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 60%, rgba(0, 0, 0, 0) 100%);
  padding-bottom: 22px;
}

/* Live Progress Track */
.timeline-container {
  width: 100%;
  height: 4px;
  cursor: pointer;
  padding: 4px 0;
}

.timeline-track {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.buffer-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  background: #ef4444;
}

/* Controls Row */
.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.controls-left, .controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.control-btn {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background-color 0.15s, transform 0.1s;
}

.control-btn:hover {
  color: #ef4444;
  background: rgba(255, 255, 255, 0.1);
}

.control-btn:active {
  transform: scale(0.95);
}

/* Live Sync Button */
.live-sync-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.08);
  transition: all 0.2s;
}

.live-sync-btn .sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ef4444;
}

.live-sync-btn.is-live {
  color: #ffffff;
}

.live-sync-btn.is-live .sync-dot {
  background-color: #ef4444;
  box-shadow: 0 0 6px #ef4444;
}

.live-sync-btn:not(.is-live) {
  color: rgba(255, 255, 255, 0.5);
}

.live-sync-btn:not(.is-live) .sync-dot {
  background-color: #888888;
  box-shadow: none;
}

/* Volume Slider */
.volume-container {
  display: flex;
  align-items: center;
  gap: 6px;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 76px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  transition: width 0.2s, background 0.15s;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #ef4444;
}

.volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  border: none;
  cursor: pointer;
}

/* Quality Select Dropdown */
.quality-wrapper {
  position: relative;
}

.quality-select {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  outline: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.quality-select:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.quality-select option {
  background-color: #16181f;
  color: #ffffff;
}

/* Utility Helpers */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .overlay-bar {
    padding: 12px 16px;
  }
  .volume-slider {
    width: 50px;
  }
}
