*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: #0f0f0f;
    
    padding: 40px;
  
  
}

.upload-container {
  text-align: center;
  margin-bottom: 20px;
  
}

.upload-btn {
  background: #1c2329;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.3s ease;
   
}

.upload-btn:hover {
  background: #0b2d52;
}

.upload-btn svg {
  width: 20px;
  height: 20px;
}

.video-container {
  position: relative;
  width: 90%;
  max-width: 1000px;
  display: flex;
  justify-content: center;
  margin-inline: auto;
  background-color: black; 
}

.video-container.theater{
  width: 100%;
  max-width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  background-color: black;
}
.video-container.full-screen {
  max-width: initial;
  width: 100%;
   
}

.video-container.theater {
  max-height: 98vh;
  overflow: hidden;
  
     
     
} 

/* Hide upload container when in theater mode */
body.theater-mode .upload-container {
  display: none;
 
}

.video-container.full-screen {
  max-height: 100vh;
}

video {
  width: 100%;
}

.video-controls-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  color: white;
  z-index: 100;
  opacity: 0;
  transition: opacity 150ms ease-in-out;
}

.video-controls-container::before {
  content: "";
  position: absolute;
  bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .75), transparent);
  width: 100%;
  aspect-ratio: 6 / 1;
  z-index: -1;
  pointer-events: none;
   
}


.video-container:hover .video-controls-container,
video-container:focus-within .video-controls-container{
opacity: 1
};
video-container.paused {
opacity: 1
};
video-controls-container {
  opacity: 1;
}

.video-controls-container .controls {
  display: flex;
  gap: .5rem;
  padding: .25rem;
  align-items: center;
  user-select: none;
}

.video-controls-container .controls button {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  height: 30px;
  width: 30px;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: .85;
  transition: opacity 150ms ease-in-out;
}

.video-controls-container .controls button:hover {
  opacity: 1;
}

.video-container.paused .pause-icon {
  display: none;
}

.video-container:not(.paused) .play-icon {
  display: none;
}

.video-container.theater .tall {
  display: none;
}

.video-container:not(.theater) .wide {
  display: none;
}

.video-container.full-screen .open {
  display: none;
}

.video-container:not(.full-screen) .close {
  display: none;
}

.volume-high-icon,
.volume-low-icon,
.volume-muted-icon {
  display: none;
}

.video-container[data-volume-level="high"] .volume-high-icon {
  display: block;
}

.video-container[data-volume-level="low"] .volume-low-icon {
  display: block;
}

.video-container[data-volume-level="muted"] .volume-muted-icon {
  display: block;
}

.volume-container {
  display: flex;
  align-items: center;
}

.volume-slider {
  width: 0;
  transform-origin: left;
  transform: scaleX(0);
  transition: width 150ms ease-in-out, transform 150ms ease-in-out;
}

.volume-container:hover .volume-slider,
.volume-slider:focus-within {
  width: 100px;
  transform: scaleX(1);
}

.duration-container {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-grow: 1;
}



/* Speed Dropdown Styles */
.speed-container {
  position: relative;
  display: inline-block;
}

.speed-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 50px;
  justify-content: center;
}

.speed-arrow {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.speed-container:hover .speed-arrow {
  transform: rotate(180deg);
}

.speed-dropdown {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(28, 28, 28, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 0;
  min-width: 80px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 1000;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.speed-container:hover .speed-dropdown {
  opacity: 1;
  visibility: visible;
}

.speed-option {
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 14px;
  color: white;
  text-align: center;
}

.speed-option:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.speed-option[data-selected="true"] {
  background-color: rgba(33, 150, 243, 0.3);
  color: #2196F3;
  font-weight: bold;
}

/* Speed Indicator */
.speed-indicator {
  position: absolute;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: semibold;
  font-size: 13px;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  animation: speedPulse 2s infinite;
}

.speed-indicator.show {
  opacity: 1;
  visibility: visible;
}

@keyframes speedPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(53, 52, 52, 0.5);
  }
}

/* Center Play/Pause Icon */
.center-play-pause {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.center-play-pause.show {
  opacity: 1;
  visibility: visible;
  animation: centerIconPulse 0.6s ease-out;
}

.center-play-pause svg {
  width: 80px;
  height: 80px;
  color: white;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.video-container.paused .center-play-icon {
  display: block;
}

.video-container.paused .center-pause-icon {
  display: none;
}

.video-container:not(.paused) .center-play-icon {
  display: none;
}

.video-container:not(.paused) .center-pause-icon {
  display: block;
}

@keyframes centerIconPulse {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* Ensure dropdown works in all screen modes */
.video-container.theater .speed-dropdown,
.video-container.full-screen .speed-dropdown,
.video-container.mini-player .speed-dropdown {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

/* Adjust for mini-player mode */
.video-container.mini-player .speed-dropdown {
  bottom: auto;
  top: 100%;
  margin-top: 8px;
}

/* Hide controls in fullscreen after timeout */
.video-container.full-screen.hide-controls .video-controls-container {
  opacity: 0;
  pointer-events: none;
}

/* Ensure controls are always visible when paused in fullscreen */
.video-container.full-screen.hide-controls.paused .video-controls-container {
  opacity: 1;
  pointer-events: auto;
}

.video-controls-container .controls button.wide-btn {
  width: 50px;
}

.timeline-container {
  height: 7px;
  margin-inline: .5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.timeline {
  background-color: rgba(100, 100, 100, .5);
  height: 3px;
  width: 100%;
  position: relative
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  right: calc(100% - var(--preview-position) * 100%);
  background-color: rgb(150, 150, 150);
  display: none;
}

.timeline::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  right: calc(100% - var(--progress-position) * 100%);
  background-color: red;
}

.timeline .thumb-indicator {
  --scale: 0;
  position: absolute;
  transform: translateX(-50%) scale(var(--scale));
  height: 200%;
  top: -50%;
  left: calc(var(--progress-position) * 100%);
  background-color: red;
  border-radius: 50%;
  transition: transform 150ms ease-in-out;
  aspect-ratio: 1 / 1;
}

.timeline .preview-img {
  position: absolute;
  height: 80px;
  aspect-ratio: 16 / 9;
  top: -1rem;
  transform: translate(-50%, -100%);
  left: calc(var(--preview-position) * 100%);
  border-radius: .25rem;
  border: 2px solid white;
  display: none;
}

.thumbnail-img {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  display: none;
}

.video-container.scrubbing .thumbnail-img {
  display: block;
}

.video-container.scrubbing .preview-img,
.timeline-container:hover .preview-img {
  display: block;
}

.video-container.scrubbing .timeline::before,
.timeline-container:hover .timeline::before {
  display: block;
}

.video-container.scrubbing .thumb-indicator,
.timeline-container:hover .thumb-indicator {
  --scale: 1;
}

.video-container.scrubbing .timeline,
.timeline-container:hover .timeline {
  height: 100%;
}

.timeline-timer {
  position: absolute;
  top: -32px;
  transform: translateX(-50%);
  background: rgba(28, 28, 28, 0.95);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  pointer-events: none;
  white-space: nowrap;
  display: none;
  z-index: 10;
}

.thumbnail-img, .preview-img {
  display: none !important;
}

.video-container.mini-player ~ .video-name {
  display: block;
}