:root{
  --bg:#000;
  --control-bg: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.0));
  --accent:#ff0000;
  --muted:#aaa;
  --youtube-red: #ff0000;
  --youtube-gray: #aaaaaa;
  --youtube-light-gray: #717171;
  --youtube-dark-gray: #272727;
  --youtube-progress: #ff0000;
  --youtube-hover: #383838;
  --youtube-controls-bg: rgba(28, 28, 28, 0.9);
  --button-bg: rgba(255, 255, 255, 0.1);
}

/* hide cursor behaviour */
.yt-player.hide-cursor:not(.paused) {
    cursor: none !important;
}
.yt-player.hide-cursor:not(.paused) video {
    cursor: none !important;
}
.yt-player.hide-cursor .controls {
    opacity: 0 !important;
    pointer-events: none;
}
.yt-player.paused.hide-cursor .controls {
    opacity: 1 !important;
    pointer-events: auto;
}

/* Player container */
.yt-player {
  width: 930px;
  max-width:100%;
  aspect-ratio: 16/9; /* keep consistent ratio */
  background:var(--bg);
  border-radius:12px;
  overflow:hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  position:relative;
  touch-action: manipulation; /* improve touch response */
}

/* Video fits container */
.yt-player video{
  display:block;
  width:100%;
  height:100%;
  object-fit: cover;
  background:#000;
  cursor: pointer;
}

/* Loading spinner */
.loading-spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 15;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top: 4px solid var(--youtube-red);
  animation: spin 1s linear infinite;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.yt-player.loading .loading-spinner {
  opacity: 1;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Loading text */
.loading-text {
  position: absolute;
  left: 50%;
  top: calc(50% + 45px);
  transform: translateX(-50%);
  z-index: 15;
  color: white;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.yt-player.loading .loading-text {
  opacity: 1;
}

/* Center big play button */
.center-play {
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  z-index:20;
  width:70px;
  height:70px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  background: var(--button-bg);
  cursor:pointer;
  transition:all .18s ease;
  opacity:0;
  pointer-events:none;
  backdrop-filter: blur(10px);
}
.yt-player.paused .center-play{
  opacity:1;
  pointer-events:auto;
}
.center-play i{
  font-size:36px;
  color:#fff;
  margin-left: 4px;
}
.center-play:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Controls */
.controls {
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  z-index:30;
  padding:0 12px 5px;
  background: var(--control-bg);
  transition: opacity .18s ease;
  opacity:0;
  backdrop-filter: blur(5px);
}

.yt-player:hover .controls,
.yt-player.controls-visible .controls {
  opacity:1;
}

.btn {
  background: var(--button-bg);
  border: none;
  color:#fff;
  font-size:20px;
  cursor:pointer;
  padding:6px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius: 50%;
  transition: all 0.2s;
  width: 36px;
  height: 36px;
}
  
.btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Progress bar area */
.progress-wrap {
  display: flex;
  align-items: center;
  height: 7px;
  cursor: pointer;
  margin-bottom: 5px;
  padding: 0 4px;
}

.progress {
  height: 4px;
  background: rgba(255,255,255,0.2);
  width: 100%;
  cursor: pointer;
  position: relative;
  overflow: visible;
  border-radius: 2px;
  transition: height 0.1s;
}
.progress:hover {
  height: 6px;
}
.progress .bar {
  position:absolute;
  left:0; top:0; bottom:0;
  height:100%;
  width:0%;
  background: var(--youtube-progress);
  transition: width .08s linear;
  border-radius: 2px;
}
.progress .buffer {
  position:absolute;
  left:0; top:0; bottom:0;
  height:100%;
  width:0%;
  background: rgba(255,255,255,0.4);
  border-radius: 2px;
}

/* Progress bar hover thumb - REMOVED */
.progress .thumb {
  display: none;
}

.time {
  min-width: 120px;
  text-align: right;
  font-family: 'Roboto', sans-serif;
  color: var(--muted);
  font-size: 18px;
  font-weight: 600;
  padding: 7px 7px;
  border-radius: 20px;
  background: var(--button-bg);
  backdrop-filter: blur(10px);
}

/* Bottom controls row */
.bottom-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.left-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.right-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

/* Volume slider - ALWAYS VISIBLE AND THICKER */
.blur-container {
  display: flex;
  align-items: center;
  position: relative;
  padding: 3px 3px;
  backdrop-filter: blur(10px);
  border-radius: 20px;
  gap: 3px;
}
  
.blur-container-time {
    display: flex;
    align-items: center;
    position: relative;
    padding: 3px 3px;
    backdrop-filter: blur(10px);
    border-radius: 20px;
}
.volume-container {
    display: flex;
    align-items: center;
    position: relative;
    background: var(--button-bg);
    border-radius: 20px;
    gap: 3px;
}
.volume-slider {
  width: 70px;
  height: 20px;
  display: flex;
  align-items: center;
}

.volume-slider input[type=range]{
  -webkit-appearance:none;
  width: 100%;
  background:transparent;
  height: 4px;
  cursor: pointer;
}

.volume-slider input[type=range]::-webkit-slider-runnable-track{
  height: 4px;
  background:rgba(255,255,255,0.3);
  border-radius: 2px;
}

.volume-slider input[type=range]::-webkit-slider-thumb{
  -webkit-appearance:none;
  width: 14px;
  height: 14px;
  border-radius:50%;
  background:#fff;
  margin-top:-5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  transition: all 0.2s;
}

.volume-slider input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  background: #f0f0f0;
}

/* Settings dropdown */
.settings-container {
  position: relative;
}

.settings-menu {
  position: absolute;
  bottom: 100%;
  right: 0;
  background: var(--youtube-controls-bg);
  border-radius: 8px;
  padding: 6px 0;
  min-width: 180px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s;
  z-index: 40;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
}

.settings-container.active .settings-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.2s;
}

.settings-item:hover {
  background: var(--youtube-hover);
}

.settings-item select {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  padding: 3px 6px;
  border-radius: 4px;
  backdrop-filter: blur(10px);
}

.settings-item select option {
  background: var(--youtube-controls-bg);
  color: #fff;
}

/* Seek indicator (visual feedback for double-tap) */
.seek-indicator {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 35;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 200ms ease, transform 200ms ease;
  font-weight: 700;
  color: white;
  -webkit-text-stroke: 0.4px rgba(0,0,0,0.6);
}
.seek-indicator.show {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}
.seek-indicator .icon {
  font-size: 34px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
}

/* Left and Right tap zones to detect double-tap without changing layout */
.tap-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28%; /* slightly narrower than halves to avoid conflicts with controls */
  z-index: 25;
}
.tap-zone.left { left: 0; }
.tap-zone.right { right: 0; }

/* Small visual hint for mobile when user taps once (optional subtle) */
.tap-hint {
  position: absolute;
  bottom: 18%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.45);
  color: #fff;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 13px;
  z-index: 34;
  opacity: 0;
  transition: opacity .18s;
}

/* Small responsive tweaks */
@media (max-width:768px){
  .center-play{ width:60px; height:60px; }
  .center-play i{ font-size:30px; }
  .volume-slider {
    width: 60px;
  }
  .time{
    font-size: 15px;
    min-width: 100px;
  }
  .btn {
    font-size: 18px;
    width: 32px;
    height: 32px;
  }
  .loading-spinner {
    width: 50px;
    height: 50px;
  }
  .loading-text {
    top: calc(50% + 40px);
    font-size: 13px;
  }
}

@media (max-width:540px){
  .center-play{ width:50px; height:50px; }
  .center-play i{ font-size:24px; }
  .time{ display:none; }
  .blur-container-time { display:none; }
  .volume-slider {
    display: none;
  }
  .btn {
    font-size: 16px;
    width: 28px;
    height: 28px;
  }
  .tap-zone { width: 36%; } /* easier to tap on small screens */
  .loading-spinner {
    width: 40px;
    height: 40px;
  }
  .loading-text {
    top: calc(50% + 35px);
    font-size: 12px;
  }
}
