:root {
  --player-blue: #007bff;
  --player-blue-glow: rgba(0, 123, 255, 0.4);
  --bg-dark: #0f0f0f;
  --control-bg: rgba(10, 10, 10, 0.75);
  --text-main: #fff;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #000;
  font-family: var(--font-family);
  overflow: hidden;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Proteção contra seleção de texto */
  user-select: none;
  -webkit-user-select: none;
}

.player {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
}

video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  pointer-events: none;
  /* Evita menu do botão direito nativo no vídeo */
}

/* Camada invisível para capturar cliques e impedir interação direta com o vídeo */
.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
}

/* Camada de Preview / Poster */
.poster-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
  background: #111;
}

.poster-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  filter: brightness(0.5);
  background-image: url('https://images.unsplash.com/photo-1508098682722-e99c43a406b2?q=80&w=1200');
}

.big-play-btn {
  position: relative;
  width: 70px;
  height: 70px;
  background: var(--player-blue);
  border-radius: 50%;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px var(--player-blue-glow);
  transition: all 0.2s ease;
  z-index: 12;
}

.big-play-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 35px var(--player-blue);
}

.big-play-btn svg {
  width: 30px;
  height: 30px;
  margin-left: 4px;
}

.poster-layer--hidden {
  opacity: 0;
  visibility: hidden;
}

/* Loader */
.loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.loader--hidden {
  opacity: 0;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 123, 255, 0.2);
  border-top: 3px solid var(--player-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 10px;
}

.loader-text {
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

/* Controles - FIX Corrigido alinhamento */
.controls-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 15px;
  /* Padding interno melhorado */
  z-index: 20;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.controls-blur {
  position: absolute;
  top: 5px;
  left: 10px;
  right: 10px;
  bottom: 5px;
  background: var(--control-bg);
  backdrop-filter: blur(12px);
  border-radius: 10px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  width: 100%;
}

.controls-left,
.controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
  /* Gap consistente */
}

.control-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  transition: all 0.2s;
  border-radius: 6px;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--player-blue);
}

.control-btn svg,
.control-btn i {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Volume Slider */
.volume-container {
  display: flex;
  align-items: center;
  margin-left: 5px;
}

.volume-slider {
  width: 0;
  height: 3px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  outline: none;
  transition: width 0.3s ease;
  overflow: hidden;
}

.volume-container:hover .volume-slider {
  width: 60px;
  margin-left: 8px;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  background: var(--player-blue);
  border-radius: 50%;
  box-shadow: -100vw 0 0 100vw var(--player-blue);
  /* Preenchimento azul à esquerda */
  cursor: pointer;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .volume-slider {
    display: none;
  }

  .controls-blur {
    left: 5px;
    right: 5px;
  }
}

.player--controls-hidden .controls-container {
  transform: translateY(10px);
  opacity: 0;
}

.message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(20, 20, 20, 0.95);
  color: var(--player-blue);
  padding: 15px 25px;
  border-radius: 8px;
  border: 1px solid var(--player-blue);
  z-index: 100;
  text-align: center;
  font-weight: bold;
}

.message--hidden {
  display: none;
}