/**
 * Custom Video Player Styling
 */

.custom-video-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 250px;
  overflow: hidden;
  border-radius: 14px;
}

.custom-video-container.featured-video {
  min-height: 400px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.custom-video-container.vertical-video {
  min-height: 350px;
}

.custom-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: #000;
  transition: transform 0.5s ease;
}

.custom-video-container:hover .custom-video {
  transform: scale(1.1);
}

/* Video Controls */
.video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 15px 15px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  display: flex;
  flex-direction: column;
  opacity: 1; /* Always visible */
  transition: opacity 0.3s ease;
  z-index: 10;
}

.custom-video-container:hover .play-overlay {
  opacity: 1;
}

/* Video title */
.video-title {
  position: absolute;
  bottom: 70px; /* Position above the controls */
  left: 0;
  right: 0;
  padding: 1rem;
  color: white;
  z-index: 2;
  pointer-events: none; /* Allow clicks to pass through */
}

.video-title h3 {
  margin: 0;
  font-size: 1.2rem;
  color: white;
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Play overlay */
.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%; /* Cover the entire video */
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 5;
  cursor: pointer;
}

.play-overlay i {
  font-size: 4rem;
  color: #e4d69f;
  transition: transform 0.2s ease;
}

.play-overlay:hover i {
  transform: scale(1.1);
}

.video-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 8px;
  position: relative;
  z-index: 15;
}

/* Control buttons */
.video-controls button {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.1rem;
  padding: 8px 12px;
  margin: 0 3px;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  position: relative;
  z-index: 20;
  min-width: 40px;
  min-height: 40px;
}

.video-controls button:active {
  transform: scale(0.95);
}

.video-controls button:hover {
  color: #e4d69f;
}

.video-controls button:focus {
  outline: none;
}

/* Ensure buttons are clickable */
.play-btn, .pause-btn, .volume-btn, .mute-btn, .speed-btn, .fullscreen-btn {
  pointer-events: auto;
}

/* Progress bar */
.progress-container {
  flex-grow: 1;
  height: 8px;
  background-color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  margin: 0 5px 8px 5px;
}

.progress-bar {
  height: 100%;
  width: 0;
  background-color: #e4d69f;
  transition: width 0.1s ease-in-out;
  border-radius: 4px;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  right: -5px;
  top: -3px;
  width: 14px;
  height: 14px;
  background-color: #e4d69f;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease;
  box-shadow: 0 0 5px rgba(228, 214, 159, 0.8);
}

.progress-container:hover .progress-bar::after {
  opacity: 1;
}

/* Volume controls */
.volume-container {
  position: relative;
  display: inline-block;
}

.volume-slider {
  position: absolute;
  bottom: 45px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 8px;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  display: none;
  cursor: pointer;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
  z-index: 30;
  padding: 8px;
}

.volume-container:hover .volume-slider {
  display: block;
}

.volume-level {
  height: 100%;
  background-color: #e4d69f;
  width: 50%;
  border-radius: 4px;
  position: relative;
}

.volume-level::after {
  content: '';
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background-color: #e4d69f;
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(228, 214, 159, 0.8);
}

/* Time display */
.time-display {
  color: white;
  font-size: 0.9rem;
  margin: 0 10px;
}

/* Speed options */
.speed-options {
  position: absolute;
  bottom: 40px;
  right: 0;
  background-color: rgba(0, 0, 0, 0.8);
  border-radius: 5px;
  padding: 5px 0;
  display: none;
}

.speed-option {
  color: white;
  padding: 5px 15px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.speed-option:hover {
  background-color: rgba(228, 214, 159, 0.3);
}

.speed-option.active {
  color: #e4d69f;
}

/* Featured video specific styles */
.featured-video .video-controls {
  padding-bottom: 15px;
}

.featured-video .play-overlay i {
  font-size: 5rem;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .video-controls button {
    padding: 5px 6px;
    font-size: 0.9rem;
    min-width: 32px;
    min-height: 32px;
  }
  
  .time-display {
    font-size: 0.7rem;
    margin: 0 3px;
  }
  
  .progress-container {
    height: 6px;
  }

  .custom-video-container.featured-video {
    min-height: 150px;
  }

  .video-title {
    bottom: 60px;
    padding: 0.5rem;
  }

  .video-title h3 {
    font-size: 0.9rem;
  }

  .play-overlay i {
    font-size: 3rem;
  }

  .video-controls {
    padding: 8px 8px 5px;
  }

  .video-controls-row {
    margin-bottom: 3px;
  }

  /* Better touch targets for mobile */
  .progress-bar::after {
    width: 16px;
    height: 16px;
    top: -5px;
  }
  
  /* Adjust spacing and sizes for better mobile experience */
  .custom-video {
    object-position: center center;
  }
  
  .volume-container {
    display: none; /* Hide volume controls on mobile to save space */
  }
  
  /* Make sure the speed button doesn't overflow */
  .speed-options {
    right: -20px;
    bottom: 35px;
  }
}
