/* =========================================
   SHOWREEL PAGE
   ========================================= */
.showreel-page {
  padding: 20px 20px 60px;
  max-width: 1440px;
  margin: 0 auto;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.showreel-page h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 1px;
}

.showreel-container {
  width: 90%;
  max-width: 1088px;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  position: relative;
}

.showreel-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.btn-close-showreel {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888888;
  text-decoration: none;
  z-index: 10;
  transition: all 0.3s ease;
}

.btn-close-showreel svg {
  width: 44px;
  height: 44px;
}

.btn-close-showreel:hover {
  transform: scale(1.15);
}

/* Make video controls always visible instead of hiding on hover out */
.custom-video-controls {
  opacity: 1 !important;
}

/* =========================================
   CUSTOM VIDEO CONTROLS
   ========================================= */
.showreel-container {
  /* Ensure container constraints for relatively positioned children */
  position: relative;
}

.custom-video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  display: flex;
  align-items: center;
  padding: 0 20px;
  box-sizing: border-box;
  opacity: 1 !important;
  z-index: 10;
}

.video-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  margin: 0 4px;
  transition: transform 0.2s;
}

.video-btn:hover {
  transform: scale(1.1);
}

.video-progress-wrapper {
  flex-grow: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  margin: 0 15px;
  border-radius: 3px;
  position: relative;
  cursor: pointer;
}

.video-progress-bar {
  height: 100%;
  width: 0%;
  background: white;
  border-radius: 3px;
  pointer-events: none;
}

.video-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  pointer-events: none;
}

/* =========================================
   SHOWREEL SLIDER
   ========================================= */
.showreel-slider-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 1200px;
}

/* Make wrapper a positioned parent so we can overlay arrows and close button */
.showreel-slider-wrapper {
  position: relative;
}

.slider-arrow {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.slider-arrow:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #fff;
}

.showreel-track {
  display: flex;
  width: 100%;
  height: 100%;
}

.showreel-slide {
  min-width: 100%;
  flex-shrink: 0;
  height: 100%;
  position: relative;
}

.showreel-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* =========================================
   SLIDER DOTS
   ========================================= */
.slider-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  width: 100%;
}

.slider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  cursor: pointer;
  padding: 0;
  transition:
    background 0.3s ease,
    transform 0.3s ease;
}

.slider-dot--active {
  background: var(--accent-red);
  transform: scale(1.3);
}

/* =========================================
   SLIDE COUNTER
   ========================================= */
.slide-counter {
  position: absolute;
  bottom: 14px;
  right: 18px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-family: "Barlow", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 100px;
  backdrop-filter: blur(4px);
  z-index: 10;
  user-select: none;
}

/* =========================================
   CUSTOM VIDEO CONTROLS (.vc)
   ========================================= */
.vc {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  z-index: 10;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.25s ease;
}

/* Show controls on hover over the slide */
.showreel-slide:hover .vc {
  opacity: 1;
}

/* Always show controls for the active slide */
.showreel-slide.is-active .vc {
  opacity: 1;
}

.vc__btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.vc__btn:hover {
  transform: scale(1.15);
}

.vc__icon {
  width: 18px;
  height: 18px;
  display: block;
}

/* Progress bar */
.vc__progress {
  flex: 1;
  cursor: pointer;
  padding: 10px 0;
  display: flex;
  align-items: center;
}

.vc__progress-bar {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  overflow: visible;
}

.vc__progress-fill {
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: 4px;
  transition: width 0.1s linear;
  pointer-events: none;
}

.vc__progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.vc__progress:hover .vc__progress-thumb {
  opacity: 1;
}

.vc__progress:hover .vc__progress-bar {
  height: 6px;
}

/* Volume Control Popup */
.vc__vol-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vc__vol-popup {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  padding: 10px 0;
  border-radius: 6px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 100px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.vc__vol-wrap:hover .vc__vol-popup {
  opacity: 1;
  visibility: visible;
}

.vc__vol-slider {
  appearance: slider-vertical;
  -webkit-appearance: slider-vertical;
  width: 4px;
  height: 80px;
  margin: 0;
  cursor: pointer;
}

/* Desktop (≥769px): scale player with viewport so it stays large on wide monitors */
@media (min-width: 769px) {
  .showreel-page {
    max-width: none;
    width: 100%;
    padding: 16px 24px 32px;
    min-height: calc(100dvh - 72px);
    justify-content: center;
    box-sizing: border-box;
  }

  .showreel-slider-wrapper {
    max-width: none;
    width: 100%;
    gap: clamp(12px, 1.5vw, 24px);
  }

  .showreel-container {
    width: min(
      calc(100vw - 180px),
      calc((100dvh - 72px - 48px) * 16 / 9)
    );
    max-width: none;
    flex: 0 1 auto;
  }
}

/* Responsive: Mobile (≤768px) — desktop unchanged */
@media (max-width: 768px) {
  /* Match the standard mobile background behavior used by other pages */
  body.page-showreel,
  body.page-showreel.light-theme {
    background-size: 100% auto;
    background-position: top center;
    background-repeat: no-repeat;
  }

  .showreel-page {
    padding: 8px;
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
    min-height: calc(100vh - 72px);
    min-height: calc(100dvh - 72px);
    justify-content: center;
    box-sizing: border-box;
  }

  /* Full-width video; prev/next in side gutters (not shrinking the player) */
  .showreel-slider-wrapper {
    display: block;
    width: 100%;
    max-width: 100%;
    padding-left: 30px;
    padding-right: 30px;
    box-sizing: border-box;
  }

  .showreel-container {
    width: 100%;
    max-width: 100%;
    border-radius: 10px;
    aspect-ratio: 16 / 9;
  }

  .slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    font-size: 14px;
    border-width: 1.5px;
    background: transparent;
    border-color: var(--border-color);
    z-index: 5;
  }

  .slider-arrow-prev {
    left: 0;
  }

  .slider-arrow-next {
    right: 0;
  }

  .slider-arrow:hover {
    transform: translateY(-50%);
  }

  /* X: pojok kanan layar (di bawah navbar), tidak overlap video/next */
  .btn-close-showreel {
    position: fixed;
    top: calc(72px + 8px);
    right: max(8px, env(safe-area-inset-right, 0px));
    left: auto;
    width: 44px;
    height: 44px;
    z-index: 101;
    background: transparent;
    border-radius: 0;
  }

  .btn-close-showreel svg {
    width: 30px;
    height: 30px;
  }

  .vc__btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
}
