html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: #000;
}

.player-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
}

#video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  z-index: 1;
  background: #000;
}

.loading-spinner {
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  pointer-events: none;
  background: rgba(0,0,0,0.5);
  color: white;
  font-family: Arial, sans-serif;
}
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(20,30,48,0.85);
  border-radius: 12px;
  padding: 20px 30px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  max-width: 80%;
  width: 300px;
}
.loading-title {
  margin: 0 0 15px;
  font-size: 1.2em;
  font-weight: bold;
  color: #fff;
}
.loading-status {
  margin: 10px 0;
  font-size: 0.9em;
  color: #ccc;
  text-align: center;
}
.progress-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  overflow: hidden;
  margin: 10px 0;
}
.progress-bar-contain#seek {
  width: 100%;
  margin: 0 12px;
  height: 8px;
}

#seek::-webkit-slider-runnable-track {
  background: linear-gradient(to right, rgba(231, 76, 60, 0.8) var(--seek-value, 0%), rgba(255, 255, 255, 0.2) var(--seek-value, 0%));
  border-radius: 10px;
  height: 8px;
}

#seek::-moz-range-track {
  background: linear-gradient(to right, rgba(231, 76, 60, 0.8) var(--seek-value, 0%), rgba(255, 255, 255, 0.2) var(--seek-value, 0%));
  border-radius: 10px;
  height: 8px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #e74c3c, #ff6b6b);
  width: 0%;
  border-radius: 4px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}
.buffering-indicator {
  display: flex;
  align-items: center;
  margin-top: 5px;
  font-size: 0.9em;
  color: #e74c3c;
}
.buffering-icon {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid #e74c3c;
  border-right: 2px solid #e74c3c;
  border-radius: 50%;
  margin-right: 8px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.error-message {
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  z-index: 20;
  background: rgba(0,0,0,0.85);
  color: #fff;
  text-align: center;
  padding: 20px;
}
.error-message h2 {
  margin: 0 0 15px;
  font-size: 1.5em;
  color: #e74c3c;
}
.error-message p {
  margin: 0 0 20px;
  font-size: 1.1em;
  max-width: 600px;
  line-height: 1.5;
}
.error-message button {
  background: #e74c3c;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s;
}
.error-message button:hover {
  background: #c0392b;
}
video {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  min-width: 0;
  min-height: 0;
  background: #000;
  border-radius: 0;
  box-shadow: none;
  outline: none;
  margin-bottom: 0;
  transition: none;
  object-fit: contain;
  display: block;
}

.custom-controls {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(20,30,48,0.85);
  border-radius: 0 0 16px 16px;
  padding: 8px 12px;
  margin-top: -8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  gap: 8px;
  position: relative;
  z-index: 2;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.4s;
  flex-wrap: wrap;
  min-height: 20px;
}
.controls-left {
  display: flex;
  align-items: center;
  gap: 2px;
}
.volume-group {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
}
body.hide-controls .custom-controls {
  opacity: 0;
  height: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none;
}
.custom-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 40%, rgba(0,0,0,0) 100%);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  opacity: 0; /* Inicialmente invisível, controlado pelo JavaScript */
  transition: all 0.3s ease;
  z-index: 100;
  pointer-events: auto;
  box-sizing: border-box;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.player-container:hover .custom-controls,
.player-container:focus-within .custom-controls,
.custom-controls:hover {
  opacity: 1;
}

.live-btn {
  background-color: #e74c3c;
  color: white;
  font-size: 0.8em;
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 20px;
  margin-right: 12px;
  opacity: 0.85;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
  width: auto;
}

.live-btn.live-active {
  opacity: 1;
  background-color: #e74c3c;
  box-shadow: 0 2px 12px rgba(231, 76, 60, 0.6);
}

.live-btn:hover {
  opacity: 1;
  transform: scale(1.05);
  box-shadow: 0 3px 15px rgba(231, 76, 60, 0.5);
}

.controls-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

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

.custom-controls button {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  outline: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  margin: 0 4px;
  width: 36px;
  height: 36px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.custom-controls button:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.btn {
  background: transparent;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
  margin: 0;
}
.btn:hover {
  background: rgba(255,255,255,0.15);
}
.btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.custom-controls button:focus {
  background: #243b55;
}

.custom-controls svg {
  display: block;
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
  transition: all 0.2s ease;
}

.custom-controls button:hover svg {
  transform: scale(1.1);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

.custom-controls input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  height: 6px;
  margin: 0 8px;
  flex: 1 1 120px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.custom-controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e74c3c;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

.custom-controls input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e74c3c;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

.custom-controls input[type="range"]:focus {
  outline: none;
}

.custom-controls input[type="range"]:hover::-webkit-slider-thumb,
.custom-controls input[type="range"]:focus::-webkit-slider-thumb {
  transform: scale(1.1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
}

.custom-controls input[type="range"]:hover::-moz-range-thumb,
.custom-controls input[type="range"]:focus::-moz-range-thumb {
  transform: scale(1.1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
}

#seek {
  flex: 3 1 180px;
  margin: 0 12px;
  height: 6px;
}

#volume {
  max-width: 120px;
  min-width: 40px;
  width: 60px;
}

#currentTime, #duration {
  color: #fff;
  font-family: monospace;
  font-size: 0.98em;
  margin: 0 4px;
  min-width: 48px;
  text-align: center;
}

@media (max-width: 600px) {
  .custom-controls {
    padding: 0 0.5vw;
    font-size: 0.78em;
    gap: 1px;
    flex-wrap: wrap;
    min-height: 22px;
  }
  .custom-controls button {
    min-width: 22px;
    min-height: 22px;
    font-size: 0.8em;
    padding: 0;
  }
  .custom-controls svg {
    width: 16px;
    height: 16px;
  }
  #volume {
    width: 40px;
    min-width: 30px;
  }
  .live-btn {
    font-size: 0.7em;
    padding: 2px 8px;
    margin-right: 4px;
    border-radius: 12px;
  }
}
.volume-slider {
  width: 80px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.3);
  outline: none;
  border-radius: 2px;
  margin: 0 8px 0 0;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}
.volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
}
.live-btn {
  font-weight: bold;
  color: #fff;
  background: #e74c3c;
  border-radius: 8px;
  padding: 3px 14px;
  margin-right: 8px;
  font-size: 0.85em;
  border: 2px solid #fff2;
  box-shadow: 0 0 8px #e74c3caa;
  animation: none;
  transition: background 0.2s, box-shadow 0.2s;
}
.live-btn.delayed {
  background: #e74c3c;
  color: #fff;
  box-shadow: none;
  border-color: #8884;
}
.live-btn.delayed:hover {
  background: #c0392b;
}
.live-btn:not(.delayed):hover {
  background: #c0392b;
}
.controls-right {
  display: flex;
  align-items: center;
}
.hidden {
  display: none !important;
}
