/* ==============================================================================
   Minhaj Platform - Custom Designed Liquid Video & Audio Player
   ============================================================================== */

.player-cinema-wrapper {
  background: #021a12;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(6, 78, 59, 0.28), 0 0 0 1.5px rgba(16, 185, 129, 0.4);
  position: relative;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-cinema-wrapper::after {
  content: '';
  position: absolute;
  inset: -15px;
  background: radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.25) 0%, transparent 70%);
  filter: blur(25px);
  z-index: -1;
  pointer-events: none;
}

.player-cinema-wrapper:hover {
  box-shadow: 0 25px 75px rgba(16, 185, 129, 0.28), 0 0 0 2.5px rgba(16, 185, 129, 0.7);
  transform: translateY(-2px);
}

.liquid-player-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
}

/* Video Canvas */
.liquid-player-box video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
  background: #000000;
}

/* Audio Visualizer Mode */
.player-audio-stage {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, #064e3b 0%, #022016 60%, #01140e 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  z-index: 2;
}

.audio-center-emblem {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid #34d399;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #34d399;
  font-size: 2.8rem;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
  animation: pulseEmblem 3s infinite ease-in-out;
}

@keyframes pulseEmblem {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(16, 185, 129, 0.2); }
  50% { transform: scale(1.05); box-shadow: 0 0 40px rgba(52, 211, 153, 0.45); }
}

.audio-wave-bars {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 48px;
}

.wave-bar {
  width: 5px;
  background: linear-gradient(to top, #059669, #34d399);
  border-radius: 4px;
  height: 10px;
  transition: height 0.15s ease;
}

.player-cinema-wrapper.is-playing .wave-bar {
  animation: waveMotion 1.2s infinite ease-in-out alternate;
}

.wave-bar:nth-child(2) { animation-delay: 0.1s !important; }
.wave-bar:nth-child(3) { animation-delay: 0.2s !important; }
.wave-bar:nth-child(4) { animation-delay: 0.3s !important; }
.wave-bar:nth-child(5) { animation-delay: 0.4s !important; }
.wave-bar:nth-child(6) { animation-delay: 0.25s !important; }
.wave-bar:nth-child(7) { animation-delay: 0.15s !important; }

@keyframes waveMotion {
  0% { height: 8px; }
  100% { height: 42px; }
}

/* Big Center Play Button Overlay */
.player-big-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}

.player-big-play-btn:hover {
  transform: translate(-50%, -50%) scale(1.1);
  background: #10b981;
  box-shadow: 0 0 35px rgba(16, 185, 129, 0.6);
}

.player-cinema-wrapper.is-playing .player-big-play-btn {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.8);
}

/* Top Information Header Bar */
.player-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(to bottom, rgba(2, 28, 20, 0.85) 0%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: 4;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.player-cinema-wrapper.is-playing.user-idle .player-top-bar,
.player-cinema-wrapper.is-playing.user-idle .player-bottom-controls {
  opacity: 0;
  pointer-events: none;
}

.player-lesson-header-title {
  color: #ffffff;
  font-weight: 800;
  font-size: 1.1rem;
  margin: 0;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.player-type-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Bottom Controls Bar */
.player-bottom-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(2, 28, 20, 0.95) 0%, rgba(2, 28, 20, 0.75) 60%, transparent 100%);
  padding: 1rem 1.5rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  z-index: 4;
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Custom Progress Bar / Scrubber */
.player-progress-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  transition: height 0.18s ease;
}

.player-progress-container:hover {
  height: 12px;
}

.player-buffered-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0%;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  pointer-events: none;
}

.player-played-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0%;
  background: linear-gradient(90deg, #059669 0%, #10b981 100%);
  border-radius: 4px;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.player-scrubber-handle {
  position: absolute;
  top: 50%;
  right: -6px;
  transform: translateY(-50%) scale(0);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #10b981;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
  transition: transform 0.18s ease;
}

.player-progress-container:hover .player-scrubber-handle {
  transform: translateY(-50%) scale(1);
}

.player-time-tooltip {
  position: absolute;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  pointer-events: none;
  display: none;
  white-space: nowrap;
}

/* Control Buttons Row */
.player-buttons-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

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

.player-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.15rem;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.player-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #34d399;
  transform: scale(1.08);
}

.player-btn:active {
  transform: scale(0.95);
}

.player-btn.btn-play-pause {
  font-size: 1.35rem;
  width: 40px;
  height: 40px;
  color: #34d399;
}

/* Volume Control */
.player-volume-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.player-volume-slider {
  width: 75px;
  height: 5px;
  accent-color: #10b981;
  cursor: pointer;
}

/* Time Display */
.player-time-display {
  color: #e2e8f0;
  font-family: 'Cairo', monospace;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  direction: ltr !important;
}

/* Speed Dropdown Menu */
.player-speed-btn {
  font-size: 0.82rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Keyboard Hint Banner */
.player-shortcuts-hint {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==============================================================================
   Theater Mode & Responsive Cinema Stage
   ============================================================================== */
.player-cinema-wrapper.theater-mode {
  border-radius: 28px;
  box-shadow: 0 30px 90px rgba(6, 78, 59, 0.4), 0 0 0 2px rgba(52, 211, 153, 0.6);
}

.player-cinema-wrapper.theater-mode .liquid-player-box {
  aspect-ratio: 21 / 9;
}

@media (max-width: 991px) {
  .player-cinema-wrapper.theater-mode .liquid-player-box {
    aspect-ratio: 16 / 9;
  }
}

/* ==============================================================================
   Playlist Syllabus Sidebar & Lesson Switcher
   ============================================================================== */
.playlist-sidebar-card {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(167, 243, 208, 0.75);
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(6, 78, 59, 0.05);
  overflow: hidden;
  transition: all 0.25s ease;
}

.playlist-sidebar-card:hover {
  box-shadow: 0 8px 30px rgba(6, 78, 59, 0.1);
}

.syllabus-search-input {
  width: 100%;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(167, 243, 208, 0.75);
  background: #f0fdf4;
  font-size: 0.85rem;
  font-weight: 600;
  color: #064e3b;
  outline: none;
  transition: all 0.2s ease;
}

.syllabus-search-input:focus {
  background: #ffffff;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.btn-switch-lesson {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 0.85rem 1.15rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(167, 243, 208, 0.4);
  color: #064e3b;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}

[dir="rtl"] .btn-switch-lesson {
  text-align: right;
}

[dir="ltr"] .btn-switch-lesson {
  text-align: left;
}

.btn-switch-lesson:hover {
  background: #ecfdf5;
  color: #059669;
}

.btn-switch-lesson.active {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.12) 0%, rgba(16, 185, 129, 0.18) 100%);
  color: #047857;
  font-weight: 800;
}

[dir="rtl"] .btn-switch-lesson.active {
  border-right: 4px solid #10b981;
}

[dir="ltr"] .btn-switch-lesson.active {
  border-left: 4px solid #10b981;
}

.lesson-order-circle {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.btn-switch-lesson.active .lesson-order-circle {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

/* ==============================================================================
   Player Tabs Navigation
   ============================================================================== */
.player-tabs-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(167, 243, 208, 0.7);
  border-radius: 16px;
  margin-bottom: 1.25rem;
}

.player-tab-btn {
  flex: 1;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: #064e3b;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-tab-btn:hover {
  background: #f0fdf4;
  color: #059669;
}

.player-tab-btn.active {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.player-tab-pane {
  display: none;
  animation: tabFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-tab-pane.active {
  display: block;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 576px) {
  .player-volume-wrap {
    display: none;
  }
  .player-buttons-row {
    gap: 6px;
  }
  .player-controls-left,
  .player-controls-right {
    gap: 6px;
  }
  .player-btn {
    font-size: 1rem;
    width: 32px;
    height: 32px;
  }
  .player-tabs-nav {
    flex-direction: column;
  }
  .player-tab-btn {
    width: 100%;
  }
}
