/* Play Layout Styles */

body {
  background-color: #000000;
}

.play-wrapper {
  min-height: calc(100vh - 60px);
  background: #000000;
}

.row-play-layout {
  height: calc(100vh - 60px);
  overflow: hidden;
}

/* ---------------- VIDEO PANE ---------------- */
.video-pane {
  background-color: #000000;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.video-player-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
}
.video-player-wrapper > iframe,
.video-player-wrapper > .custom-video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Custom Video Player UI */
.custom-video-container {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: var(--sd-dark);
  overflow: hidden;
  border-radius: var(--sd-radius-md);
}

.custom-video-element {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
}

/* Overlay that contains all controls */
.video-controls-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none; /* Let clicks pass through to video initially */
}

/* Show controls on hover or when paused/active */
.custom-video-container:hover .video-controls-overlay,
.video-controls-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Top gradient for back buttons/titles if needed */
.controls-top-bar {
  height: 60px;
  background: linear-gradient(to bottom, rgba(10, 10, 10, 0.8) 0%, transparent 100%);
}

/* Center Play Button */
.controls-center-action {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background-color: rgba(138, 43, 226, 0.7); /* var(--sd-primary) with opacity */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
  z-index: 2;
  box-shadow: var(--sd-shadow-glow);
}

.controls-center-action:hover {
  transform: translate(-50%, -50%) scale(1.1);
  background-color: var(--sd-primary);
}

.center-play-icon {
  font-size: 3rem;
  color: var(--sd-light);
  margin-left: 6px; /* slightly offset for visual center of play icon */
}

/* Bottom Controls Bar */
.controls-bottom-bar {
  background: linear-gradient(to top, rgba(10, 10, 10, 0.95) 0%, rgba(10, 10, 10, 0.6) 70%, transparent 100%);
  z-index: 2;
}

/* Control Buttons */
.control-btn {
  background: none;
  border: none;
  color: var(--sd-light);
  cursor: pointer;
  transition: color 0.2s ease, transform 0.1s;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-btn:hover {
  color: var(--sd-primary);
}

.control-btn:active {
  transform: scale(0.9);
}

/* Volume Slider */
.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  background: rgba(232, 224, 240, 0.3); /* slightly transparent sd-light */
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sd-primary);
  cursor: pointer;
  box-shadow: var(--sd-shadow-glow);
}

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

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

.video-progress-bar {
  height: 100%;
  background-color: var(--sd-primary);
  border-radius: 3px;
  width: 0%; /* updated via JS */
  pointer-events: none;
}

.video-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%; /* updated via JS */
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background-color: var(--sd-light);
  border-radius: 50%;
  box-shadow: var(--sd-shadow-glow);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.video-progress-container:hover .video-progress-thumb {
  opacity: 1;
}

/* Loading Spinner */
.video-loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
}

/* Info Box */
.video-info-box {
  background: #000000;
}

.episode-title {
  color: #fff;
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.episode-description {
  font-size: 1.15rem;
  line-height: 1.6;
  color: #fff;
}

.badge {
  font-weight: 500;
  border-radius: 4px;
}

.badge-free {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.badge-paid, .badge-sub {
  background-color: #fce38a;
  color: #000;
}

/* Shared Action Buttons (from partials) */
.btn-action-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 8px 18px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--sd-transition);
}

.btn-action-outline:hover {
  background: rgba(138, 43, 226, 0.2);
  border-color: var(--sd-primary);
}

.btn-action-outline.active {
  background: rgba(138, 43, 226, 0.25);
  border-color: var(--sd-primary);
  color: var(--sd-accent);
}

/* Action Buttons (Like) */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--sd-light);
  padding: 8px 18px;
  border-radius: 24px;
  cursor: pointer;
  font-size: 17px;
  font-weight: 500;
  transition: var(--sd-transition);
}

.action-btn:hover {
  background: rgba(138, 43, 226, 0.2);
  border-color: var(--sd-primary);
  color: #fff;
}

.action-btn.liked {
  background: rgba(138, 43, 226, 0.25);
  border-color: var(--sd-primary);
  color: var(--sd-accent);
}

.action-btn.liked i {
  color: var(--sd-accent);
}

/* Share Buttons */
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--sd-light);
  font-size: 19px;
  cursor: pointer;
  transition: var(--sd-transition);
  text-decoration: none;
}

.share-btn:hover {
  background: rgba(138, 43, 226, 0.2);
  border-color: var(--sd-primary);
  color: #fff;
}

/* Synopsis Section */
.synopsis-label {
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 1;
}

/* ---------------- PLAYLIST PANE ---------------- */
.playlist-pane {
  background-color: #050505;
  height: 100%;
  overflow-y: auto;
  border-left: 1px solid rgba(255, 255, 255, 0.02);
}

.playlist-header {
  background-color: rgba(18, 11, 32, 0.95);
  backdrop-filter: blur(10px);
  z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Item cards */
.playlist-item-card {
  transition: var(--sd-transition);
  background-color: transparent;
  cursor: pointer;
  border-radius: var(--sd-radius-md) !important;
}

.playlist-item-card:hover {
  background-color: rgba(138, 43, 226, 0.1);
}

/* Active State */
.playlist-item-card.active {
  background-color: rgba(138, 43, 226, 0.2); /* var(--sd-primary) with opacity */
  border-left: 4px solid var(--sd-primary);
}

/* Thumbnails - Significantly Increased */
.list-img-wrapper {
  width: 160px; /* Was 132px */
  height: 90px; /* Was 74px */
  background-color: var(--sd-darker);
  border-radius: var(--sd-radius-sm);
  overflow: hidden;
}

.playing-overlay, .play-overlay {
  background-color: rgba(10, 10, 10, 0.6);
  opacity: 0;
  transition: var(--sd-transition);
}

/* Playing overlay is always visible on active */
.playlist-item-card.active .playing-overlay {
  opacity: 1;
  background-color: rgba(138, 43, 226, 0.6);
}

.playlist-item-card:hover:not(.active) .play-overlay {
  opacity: 1;
}

.title-line-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Custom Scrollbar for Playlist Pane */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ---------------- RESPONSIVENESS ---------------- */
@media (max-width: 991.98px) {
  .play-wrapper {
    min-height: auto;
  }
  .row-play-layout {
    height: auto;
    overflow: visible;
  }
  .video-pane {
    height: auto;
    overflow: visible;
  }
  .playlist-pane {
    height: auto;
    max-height: none;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  .video-info-box {
    padding: 1rem !important;
  }
  .episode-title {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .list-img-wrapper {
    width: 120px;
    height: 68px;
  }
  .playlist-item-card h6 {
    font-size: 15px !important;
  }
  .playlist-header h5 {
    font-size: 17px !important;
  }
}
