/* Custom Premium Video Player Styles */

.nuvista-player-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  /* Removed border-radius here since the parent video-player-section has it, but added for isolation if used elsewhere */
  border-radius: inherit;
  font-family: "Poppins", sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nuvista-player-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Play/Pause Center Overlay */
.player-center-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 10;
  backdrop-filter: blur(4px);
}

.player-center-play.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  animation: fadeOut 1s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.5s;
}

@keyframes fadeOut {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.5);
  }
}

/* Double Tap Ripple Indicators */
.ripple-indicator {
  position: absolute;
  top: 0;
  bottom: 0px; /* Leave space for controls */
  width: 30%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}

.ripple-indicator.left {
  left: 0;
  border-top-right-radius: 50%;
  border-bottom-right-radius: 50%;
}

.ripple-indicator.right {
  right: 0;
  border-top-left-radius: 50%;
  border-bottom-left-radius: 50%;
}

.ripple-indicator.active {
  animation: rippleFade 0.7s forwards;
}

.ripple-indicator i {
  font-size: 2rem;
  color: #fff;
  margin-bottom: 5px;
}

.ripple-indicator span {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

@keyframes rippleFade {
  0% {
    opacity: 0;
    background: rgba(255, 255, 255, 0);
  }
  20% {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
  }
  100% {
    opacity: 0;
    background: rgba(255, 255, 255, 0);
  }
}

/* Control Bar Overlay */
.player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(0, 0, 0, 0.5) 60%,
    transparent 100%
  );
  padding: 20px 15px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  z-index: 20;
  opacity: 1;
}

.nuvista-player-container.hide-controls .player-controls {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

/* Progress Bar Container */
.progress-container {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  transition: height 0.2s ease;
}

.progress-container:hover {
  height: 8px;
}

.progress-filled {
  height: 100%;
  background: #ff6b6b;
  border-radius: 3px;
  position: relative;
  width: 0%;
}

.progress-filled::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 12px;
  height: 12px;
  background: #ff6b6b;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 0 5px rgba(255, 107, 107, 0.8);
}

.progress-container:hover .progress-filled::after {
  transform: translateY(-50%) scale(1);
}

/* Controls Grid row */
.controls-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.controls-left,
.controls-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.player-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    color 0.2s,
    transform 0.2s;
  padding: 5px;
}

.player-btn:hover {
  color: #ff6b6b;
  transform: scale(1.1);
}

/* Time display */
.time-display {
  color: #fff;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.time-display span {
  opacity: 0.7;
}

/* Volume Control */
.volume-container {
  display: flex;
  align-items: center;
  gap: 5px;
  position: relative;
}

.volume-slider {
  width: 0;
  opacity: 0;
  transform-origin: left;
  transition:
    width 0.3s ease,
    opacity 0.3s ease;
  overflow: hidden;
}

.volume-container:hover .volume-slider {
  width: 70px;
  opacity: 1;
}

/* Native range input styling override */
input[type="range"].noui-slider {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}
input[type="range"].noui-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 12px;
  width: 12px;
  border-radius: 50%;
  background: #ff6b6b;
  cursor: pointer;
  margin-top: -4px;
  box-shadow: 0 0 5px rgba(255, 107, 107, 0.8);
}
input[type="range"].noui-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

/* Mobile specific styling */
@media (max-width: 768px) {
  .controls-left,
  .controls-right {
    gap: 15px;
  }
  .player-btn {
    font-size: 1.3rem;
    padding: 8px;
    min-width: 44px; /* Apple HCI guidelines min tap target */
    min-height: 44px;
  }
  .volume-container {
    display: none; /* Hide volume slider on mobile, let physical buttons rule */
  }
  .time-display {
    font-size: 0.85rem;
    padding: 0 5px;
  }
  .player-controls {
    padding: 30px 15px 15px; /* Better spacing at bottom */
  }
  .progress-container {
    height: 8px; /* Easier to tap progress bar */
  }
}
