/* === Player Container === */
.myplayer-container {
  position: relative;
  max-width: 960px;
  margin: 2em auto;
  background: #000;
  font-family: sans-serif;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.myplayer-container video,
.myplayer-container canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
}

/* === Center Play Button === */
#centerPlay {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 64px;
  color: white;
  cursor: pointer;
  transform: translate(-50%, -50%);
  z-index: 14;
  opacity: 0.85;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
}
#centerPlay:hover {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.05);
}
#centerPlay.hidden {
  display: none !important;
}

/* === Controls Container === */
#controls {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 0.5em 1em;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.4em;
  box-sizing: border-box;
  opacity: 1;
  transition: opacity 0.3s ease;
}
#controls.visible {
  opacity: 1;
}

/* === Seek Row === */
.control-row.seek-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75em;
}
#seek {
  flex: 1;
  height: 6px;
  appearance: none;
  background: #888;
  border-radius: 3px;
  cursor: pointer;
}
#seek::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  background: #3aa3e3;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  -webkit-appearance: none;
}
#seek::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #3aa3e3;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

/* === Time Display === */
#timeDisplay {
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
  text-align: right;
  min-width: 60px;
}

/* === Buttons Row === */
.control-row.buttons-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.left-controls,
.right-controls {
  display: flex;
  align-items: center;
  gap: 0.6em;
}

/* === Button Styles === */
.control-btn {
  background: none;
  border: none;
  color: white;
  padding: 0.3em;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.3s ease;
}
.control-btn:hover {
  opacity: 0.8;
}
.control-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* === Volume === */
.volume-wrapper {
  display: flex;
  align-items: center;
  gap: 0.4em;
}
.volume-slider {
  width: 80px;
  max-width: 100px;
  height: 6px;
  background: #888;
  border-radius: 5px;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 14px;
  width: 14px;
  border-radius: 50%;
  background: #3aa3e3;
  cursor: pointer;
}
.volume-slider::-moz-range-thumb {
  height: 14px;
  width: 14px;
  border-radius: 50%;
  background: #3aa3e3;
  cursor: pointer;
}

/* === Responsive (Shrink Instead of Stack) === */
@media (max-width: 600px) {
  #controls {
    padding: 0.3em 0.5em;
  }
  .control-btn svg {
    width: 18px;
    height: 18px;
  }
  #timeDisplay {
    font-size: 11px;
  }
  .volume-slider {
    width: 50px;
  }
  .left-controls,
  .right-controls {
    gap: 0.4em;
  }
}

/* === Loader Spinner === */
#loader {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 1000;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.hidden { display: none !important; }

/* === Watermark === */
#watermarkCanvas {
  position: absolute;
  pointer-events: none;
  z-index: 5;
}

/* === Password Overlay === */
.video-password-prompt-overlay {
  position: absolute;
  z-index: 15;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
}
.video-password-prompt {
  background: #222;
  padding: 2em;
  border-radius: 8px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 1em;
  width: 100%;
  max-width: 320px;
}
.video-password-input {
  padding: 0.5em 1em;
  background: #333;
  border: none;
  border-radius: 4px;
  color: #fff;
}
.video-password-submit {
  padding: 0.6em 1em;
  background: #3aa3e3;
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
}
.video-password-error {
  color: #f66;
  font-size: 0.9em;
  display: none;
}

/* === Remove Button Focus Borders === */
.control-btn:focus,
.volume-slider:focus,
#seek:focus,
.video-password-input:focus,
.video-password-submit:focus {
  outline: none;
  box-shadow: none;
  border: none;
}

