/* ============================================================
 * Filmino Unified Online Cinema Video Player Stylesheet
 * Standardized across Cinema Plus & Radar Film
 * Modern, Immersive, RTL-Native, Zero-Lag, Fully Responsive
 * ============================================================ */

:root {
  --fp-accent: #E9A23B;
  --fp-accent-hover: #F5BC5C;
  --fp-glow: rgba(233, 162, 59, 0.35);
  --fp-bg: #070605;
  --fp-panel: rgba(28, 24, 21, 0.94);
  --fp-border: rgba(255, 255, 255, 0.12);
  --fp-text: #FFFFFF;
  --fp-text-sub: #C9BDAE;
}

/* Theme Variant: Radar Film */
.filmino-player-container[data-theme="radar-film"],
body.theme-radar-film .filmino-player-container {
  --fp-accent: #e5304d;
  --fp-accent-hover: #ff5470;
  --fp-glow: rgba(229, 48, 77, 0.4);
  --fp-bg: #0a0a0f;
  --fp-panel: rgba(22, 22, 31, 0.95);
  --fp-border: rgba(255, 255, 255, 0.12);
  --fp-text: #FFFFFF;
  --fp-text-sub: #a0a0b8;
}

/* Theme Variant: Filmino Classic */
.filmino-player-container[data-theme="classic"],
.filmino-player-container[data-theme="filmino-classic"],
body.theme-classic .filmino-player-container {
  --fp-accent: #7673cf;
  --fp-accent-hover: #8e8bf0;
  --fp-glow: rgba(118, 115, 207, 0.45);
  --fp-bg: #080911;
  --fp-panel: rgba(18, 19, 32, 0.96);
  --fp-border: rgba(255, 255, 255, 0.14);
  --fp-text: #FFFFFF;
  --fp-text-sub: #94a3b8;
}

.filmino-player-container[data-theme="classic"] .fplayer-menu-item.is-selected {
  background: rgba(118, 115, 207, 0.18);
  color: var(--fp-accent);
}

.filmino-player-container[data-theme="classic"] .fplayer-episode-card.is-playing {
  background: rgba(118, 115, 207, 0.12);
  border-color: var(--fp-accent);
}

.filmino-player-container[data-theme="classic"] .fplayer-season-tab.is-active {
  background: var(--fp-accent);
  color: #FFFFFF;
  box-shadow: 0 4px 14px var(--fp-glow);
}

/* Standalone Toast Root & Notification Toasts */
#toastRoot {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

@media (max-width: 640px) {
  #toastRoot {
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100vw - 2rem);
    max-width: 380px;
  }
}

.fplayer-custom-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.1rem;
  border-radius: 12px;
  background: var(--fp-panel);
  border: 1px solid var(--fp-border);
  border-right: 3px solid var(--fp-accent);
  color: #FFFFFF;
  font-size: 0.825rem;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Global Shell */
.filmino-player-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-color: #000000;
  overflow: hidden;
  font-family: 'Estedad', 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif;
  direction: rtl;
  user-select: none;
  -webkit-user-select: none;
  z-index: 9999;
}

/* Cursor hidden during playback when HUD is idle */
.filmino-player-container.hud-idle {
  cursor: none !important;
}

/* Background Ambient Lighting */
.fplayer-ambient-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(80px) brightness(0.22);
  opacity: 0.65;
  transform: scale(1.15);
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.5s ease;
}

/* Video Stage */
.fplayer-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  background-color: transparent;
}

.fplayer-video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: transparent;
}

/* Subtitle Soft-Sub Layer */
.fplayer-subtitle-layer {
  position: absolute;
  bottom: 84px;
  inset-x: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  pointer-events: none;
  z-index: 15;
  padding: 0 1.5rem;
  transition: bottom 0.25s ease;
}

.filmino-player-container.hud-idle .fplayer-subtitle-layer {
  bottom: 36px;
}

.fplayer-subtitle-bubble {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #FFFFFF;
  padding: 8px 18px;
  border-radius: 10px;
  font-size: clamp(15px, 2.2vw, 22px);
  font-weight: 600;
  line-height: 1.6;
  direction: rtl;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95);
  max-width: 820px;
  letter-spacing: 0.2px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* HUD Overlay Layer */
.fplayer-hud {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 20;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.fplayer-hud.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Top Bar */
.fplayer-top-bar {
  position: relative;
  width: 100%;
  padding: max(1rem, env(safe-area-inset-top, 16px)) 1.5rem 2rem;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  pointer-events: auto;
  z-index: 25;
}

.fplayer-top-right {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-width: 0;
}

.fplayer-top-left {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  shrink: 0;
}

/* Back Button */
.fplayer-btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--fp-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #FFFFFF;
  padding: 0.55rem 0.95rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fplayer-btn-back:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(2px);
}

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

/* Title & Info */
.fplayer-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.fplayer-meta-title {
  color: #FFFFFF;
  font-size: clamp(0.95rem, 1.8vw, 1.25rem);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.fplayer-meta-sub {
  color: var(--fp-text-sub);
  font-size: clamp(0.72rem, 1.2vw, 0.85rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.9;
}

/* Pixel-Perfect Equal Height Alignment for Top Bar Elements */
.fplayer-top-bar .fplayer-btn-back,
.fplayer-top-bar .fplayer-badge-pill,
.fplayer-top-bar .fplayer-icon-btn {
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
}

.fplayer-top-bar .fplayer-icon-btn {
  width: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  border-radius: 50% !important;
  padding: 0 !important;
}

.fplayer-top-bar .fplayer-badge-pill {
  padding: 0 0.85rem !important;
  border-radius: 9999px !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  gap: 0.4rem !important;
}

.fplayer-top-bar .fplayer-btn-back {
  padding: 0 1rem !important;
  border-radius: 9999px !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  gap: 0.45rem !important;
}

/* Action Icon Buttons */
.fplayer-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--fp-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
  box-sizing: border-box;
}

.fplayer-icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--fp-accent);
  color: var(--fp-accent);
  transform: scale(1.06);
}

.fplayer-icon-btn:active {
  transform: scale(0.93);
}

.fplayer-icon-btn.is-active {
  background: var(--fp-accent);
  border-color: var(--fp-accent);
  color: #000000;
  box-shadow: 0 0 16px var(--fp-glow);
}

/* Bottom Bar Play/Pause Button SVG States */
.fplayer-play-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #FFFFFF !important;
  background: rgba(255, 255, 255, 0.12) !important;
}

.fplayer-play-btn:hover {
  background: var(--fp-accent) !important;
  border-color: var(--fp-accent) !important;
  color: #000000 !important;
  box-shadow: 0 0 14px var(--fp-glow);
}

.fplayer-play-btn .icon-svg-play {
  display: block !important;
  width: 18px;
  height: 18px;
  fill: currentColor;
  margin-right: -1px; /* Optical center for triangle */
}

.fplayer-play-btn .icon-svg-pause {
  display: none !important;
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.filmino-player-container.is-playing .fplayer-play-btn .icon-svg-play {
  display: none !important;
}

.filmino-player-container.is-playing .fplayer-play-btn .icon-svg-pause {
  display: block !important;
}

/* Center Stage Play/Pause & Spinner */
.fplayer-center-stage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  z-index: 22;
}

.fplayer-big-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--fp-accent);
  color: #000000;
  display: none !important;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 36px var(--fp-glow);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
  border: none;
  outline: none;
  z-index: 2;
}

.fplayer-big-play:hover {
  transform: scale(1.1);
  background: var(--fp-accent-hover);
}

.fplayer-big-play:active {
  transform: scale(0.94);
}

/* Spinner is centered concentric */
.fplayer-spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 64px;
  height: 64px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--fp-accent);
  border-radius: 50%;
  animation: fplayer-spin 0.8s linear infinite;
  display: none !important;
  pointer-events: none;
  z-index: 3;
}

/* Paused state: show Big Play */
.fplayer-center-stage.is-paused:not(.is-loading) .fplayer-big-play {
  display: flex !important;
}

/* Loading state: show Spinner, hide Play Button */
.fplayer-center-stage.is-loading .fplayer-spinner {
  display: block !important;
}

.fplayer-center-stage.is-loading .fplayer-big-play {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@keyframes fplayer-spin {
  to { transform: rotate(360deg); }
}

/* Double Tap Ripple Skip Indicators */
.fplayer-skip-ripple {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  z-index: 23;
  transition: opacity 0.2s ease;
}

.fplayer-skip-ripple.ripple-right {
  right: 0;
}

.fplayer-skip-ripple.ripple-left {
  left: 0;
}

.fplayer-skip-ripple.is-active {
  opacity: 1;
  animation: fplayer-ripple-pulse 0.75s ease-out forwards;
}

.fplayer-skip-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(14px);
  border-radius: 50%;
  width: 84px;
  height: 84px;
  justify-content: center;
  color: #FFFFFF;
  border: 1px solid var(--fp-border);
}

@keyframes fplayer-ripple-pulse {
  0% { transform: scale(0.85); opacity: 0.2; }
  40% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}

/* Bottom Controls Section */
.fplayer-bottom-bar {
  position: relative;
  width: 100%;
  padding: 2.5rem 1.5rem max(1rem, env(safe-area-inset-bottom, 16px));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.94) 0%, rgba(0, 0, 0, 0.75) 55%, transparent 100%);
  pointer-events: auto;
  z-index: 25;
}

/* Timeline Scrubber Container */
.fplayer-timeline-wrapper {
  position: relative;
  width: 100%;
  height: 26px;
  display: flex;
  align-items: center;
  cursor: pointer;
  direction: ltr; /* Video timeline always advances Left to Right */
  touch-action: none;
  margin-bottom: 0.75rem;
}

.fplayer-timeline-track {
  position: relative;
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  overflow: visible;
  transition: height 0.15s ease;
}

.fplayer-timeline-wrapper:hover .fplayer-timeline-track,
.fplayer-timeline-wrapper.is-scrubbing .fplayer-timeline-track {
  height: 8px;
}

.fplayer-timeline-buffer {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: rgba(255, 255, 255, 0.32);
  border-radius: 9999px;
  pointer-events: none;
  transition: width 0.2s ease;
}

.fplayer-timeline-played {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: var(--fp-accent);
  box-shadow: 0 0 10px var(--fp-glow);
  border-radius: 9999px;
  pointer-events: none;
}

.fplayer-timeline-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.7);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.fplayer-timeline-wrapper:hover .fplayer-timeline-thumb,
.fplayer-timeline-wrapper.is-scrubbing .fplayer-timeline-thumb {
  transform: translate(-50%, -50%) scale(1);
}

/* Scrubber Tooltip */
.fplayer-tooltip {
  position: absolute;
  top: -36px;
  left: 0%;
  transform: translateX(-50%);
  background: rgba(18, 15, 13, 0.95);
  border: 1px solid var(--fp-border);
  color: #FFFFFF;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  z-index: 30;
}

.fplayer-timeline-wrapper:hover .fplayer-tooltip,
.fplayer-timeline-wrapper.is-scrubbing .fplayer-tooltip {
  opacity: 1;
}

/* Controls Bar Row */
.fplayer-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  direction: ltr; /* Playback on Left, Tools on Right */
}

.fplayer-ctrl-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Time Indicator */
.fplayer-time-display {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: clamp(0.75rem, 1.2vw, 0.88rem);
  font-weight: 600;
  color: #FFFFFF;
  direction: ltr; /* Numbers flow LTR */
  padding: 0 0.5rem;
}

.fplayer-time-display .separator {
  color: rgba(255, 255, 255, 0.4);
}

.fplayer-time-display .total {
  color: var(--fp-text-sub);
}

/* Volume Bar (Redesigned matching main timeline scrubber) */
.fplayer-vol-wrapper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
}

.fplayer-vol-slider {
  width: 0;
  opacity: 0;
  overflow: visible;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  display: flex;
  align-items: center;
  padding: 0 4px;
}

.fplayer-vol-wrapper:hover .fplayer-vol-slider,
.fplayer-vol-wrapper.is-scrubbing .fplayer-vol-slider,
.fplayer-vol-wrapper:focus-within .fplayer-vol-slider {
  width: 86px;
  opacity: 1;
}

.fplayer-vol-track {
  position: relative;
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  cursor: pointer;
  touch-action: none;
  direction: ltr; /* Volume increases Left-to-Right */
  transition: height 0.15s ease;
}

.fplayer-vol-wrapper:hover .fplayer-vol-track,
.fplayer-vol-wrapper.is-scrubbing .fplayer-vol-track {
  height: 6px;
}

.fplayer-vol-filled {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 85%;
  background: var(--fp-accent);
  box-shadow: 0 0 8px var(--fp-glow);
  border-radius: 9999px;
  pointer-events: none;
  transition: width 0.05s ease;
}

.fplayer-vol-thumb {
  position: absolute;
  top: 50%;
  left: 85%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.fplayer-vol-wrapper:hover .fplayer-vol-thumb,
.fplayer-vol-wrapper.is-scrubbing .fplayer-vol-thumb {
  transform: translate(-50%, -50%) scale(1);
}

/* Floating Custom Tooltip System (Smart Adaptive Placement) */
.fplayer-floating-tooltip {
  position: absolute;
  background: rgba(18, 15, 13, 0.94);
  border: 1px solid var(--fp-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #FFFFFF;
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  z-index: 85;
  direction: rtl;
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.18s;
}

/* Placed above the target: slides up into position */
.fplayer-floating-tooltip.placement-top {
  transform: translateX(-50%) translateY(4px) scale(0.95);
}

.fplayer-floating-tooltip.placement-top.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* Placed below the target: slides down into position (for top bar buttons) */
.fplayer-floating-tooltip.placement-bottom {
  transform: translateX(-50%) translateY(-4px) scale(0.95);
}

.fplayer-floating-tooltip.placement-bottom.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
}

.fplayer-floating-tooltip.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
}

.fplayer-floating-tooltip .shortcut-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.14);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  margin-right: 5px;
  color: var(--fp-accent);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Floating Dropup Menus (Quality & Speed) */
.fplayer-dropup {
  position: relative;
}

.fplayer-menu-panel {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(10px) scale(0.96);
  background: var(--fp-panel);
  border: 1px solid var(--fp-border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 14px;
  padding: 0.45rem;
  min-width: 140px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65);
  display: none;
  flex-direction: column;
  gap: 0.2rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 40;
}

.fplayer-menu-panel.is-open {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateX(-50%) translateY(0) scale(1) !important;
}

.fplayer-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  color: #FFFFFF;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  transition: background 0.15s ease, color 0.15s ease;
  direction: rtl;
}

.fplayer-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--fp-accent);
}

.fplayer-menu-item.is-selected {
  background: rgba(233, 162, 59, 0.15);
  color: var(--fp-accent);
}

.filmino-player-container[data-theme="radar-film"] .fplayer-menu-item.is-selected {
  background: rgba(229, 48, 77, 0.15);
  color: var(--fp-accent);
}

/* In-Player Episode Drawer */
.fplayer-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.fplayer-drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.fplayer-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 88vw;
  background: var(--fp-panel);
  border-left: 1px solid var(--fp-border);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.8);
  z-index: 55;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.fplayer-drawer.is-open {
  transform: translateX(0);
}

/* Drawer Header */
.fplayer-drawer-header {
  padding: max(1.25rem, env(safe-area-inset-top, 16px)) 1.25rem 1rem;
  border-bottom: 1px solid var(--fp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.fplayer-drawer-title {
  color: #FFFFFF;
  font-size: 1.05rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Season Tabs */
.fplayer-season-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--fp-border);
  background: rgba(0, 0, 0, 0.2);
}

.fplayer-season-tabs::-webkit-scrollbar {
  display: none;
}

.fplayer-season-tab {
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--fp-border);
  color: var(--fp-text-sub);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fplayer-season-tab:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
}

.fplayer-season-tab.is-active {
  background: var(--fp-accent);
  border-color: var(--fp-accent);
  color: #000000;
  box-shadow: 0 0 14px var(--fp-glow);
}

/* Episode List */
.fplayer-episodes-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.fplayer-episodes-list::-webkit-scrollbar {
  width: 5px;
}

.fplayer-episodes-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
}

/* Episode Card */
.fplayer-episode-card {
  display: flex;
  gap: 0.85rem;
  padding: 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.fplayer-episode-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.fplayer-episode-card.is-playing {
  background: rgba(233, 162, 59, 0.1);
  border-color: var(--fp-accent);
}

.filmino-player-container[data-theme="radar-film"] .fplayer-episode-card.is-playing {
  background: rgba(229, 48, 77, 0.1);
  border-color: var(--fp-accent);
}

.fplayer-ep-thumb {
  position: relative;
  width: 104px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  shrink: 0;
  background: #000000;
}

.fplayer-ep-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fplayer-ep-duration {
  position: absolute;
  bottom: 3px;
  left: 4px;
  background: rgba(0, 0, 0, 0.75);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
}

.fplayer-ep-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
}

.fplayer-ep-title {
  color: #FFFFFF;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fplayer-ep-desc {
  color: var(--fp-text-sub);
  font-size: 0.72rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fplayer-ep-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--fp-accent);
  font-size: 0.7rem;
  font-weight: 800;
  margin-top: 0.25rem;
}

/* ==========================================================================
   Modular & Responsive Resume Watching Prompt (Toast Component)
   ========================================================================== */
.fplayer-resume-toast {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%) translateY(-14px) scale(0.96);
  width: auto;
  min-width: 320px;
  max-width: min(92vw, 480px);
  background: var(--fp-panel);
  border: 1px solid var(--fp-border);
  border-right: 3.5px solid var(--fp-accent);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 0.65rem 0.95rem;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 20px var(--fp-glow);
  z-index: 70;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.28s;
  direction: rtl;
  box-sizing: border-box;
}

.fplayer-resume-toast.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.fplayer-resume-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex: 1 1 auto;
}

.fplayer-resume-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--fp-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--fp-accent);
}

.fplayer-resume-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}

.fplayer-resume-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: #FFFFFF;
  white-space: nowrap;
}

.fplayer-resume-detail {
  font-size: 0.72rem;
  color: var(--fp-text-sub);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.fplayer-resume-time {
  font-family: inherit;
  font-weight: 800;
  color: var(--fp-accent);
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

.fplayer-resume-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.fplayer-btn-resume {
  background: var(--fp-accent);
  color: #000000;
  font-weight: 800;
  font-size: 0.76rem;
  padding: 0.42rem 0.85rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.fplayer-btn-resume:hover {
  transform: scale(1.04);
  box-shadow: 0 0 12px var(--fp-glow);
}

.fplayer-btn-resume:active {
  transform: scale(0.96);
}

.fplayer-btn-restart {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--fp-border);
  color: var(--fp-text-sub);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 0.42rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.fplayer-btn-restart:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
}

.fplayer-btn-restart:active {
  transform: scale(0.96);
}

.fplayer-btn-dismiss {
  background: transparent;
  border: none;
  color: var(--fp-text-sub);
  padding: 0.35rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
  opacity: 0.7;
}

.fplayer-btn-dismiss:hover {
  opacity: 1;
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
}

/* Screen Lock Indicator Pill */
.fplayer-lock-pill {
  position: absolute;
  top: max(20px, env(safe-area-inset-top, 16px));
  left: 20px;
  background: var(--fp-panel);
  border: 1px solid var(--fp-accent);
  color: #FFFFFF;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 95;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75), 0 0 18px var(--fp-glow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  direction: rtl;
}

.fplayer-lock-pill:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85), 0 0 24px var(--fp-glow);
}

.fplayer-lock-pill:active {
  transform: scale(0.96);
}

.fplayer-lock-pill.is-flashing {
  animation: fplayer-pulse-lock 0.6s ease;
}

@keyframes fplayer-pulse-lock {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); box-shadow: 0 0 28px var(--fp-glow); }
  100% { transform: scale(1); }
}

/* Mobile Specific Optimizations (Zero Overflow, Maximum Ergonomics) */
@media (max-width: 768px) {
  .fplayer-resume-toast {
    top: max(68px, env(safe-area-inset-top, 14px) + 52px) !important;
    width: calc(100% - 24px) !important;
    max-width: 420px !important;
  }

  .fplayer-top-bar {
    padding: max(0.75rem, env(safe-area-inset-top, 12px)) 1rem 1.25rem !important;
  }

  .fplayer-bottom-bar {
    padding: 1.25rem 0.75rem max(0.85rem, env(safe-area-inset-bottom, 12px)) !important;
    overflow: visible !important;
  }

  .fplayer-controls-row {
    width: 100% !important;
    max-width: 100% !important;
    gap: 0.25rem !important;
    overflow: visible !important;
  }

  .fplayer-ctrl-group {
    gap: 0.35rem !important;
    flex-shrink: 0 !important;
  }

  .fplayer-btn-back span {
    display: none !important; /* Icon only on mobile */
  }

  .fplayer-icon-btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    flex-shrink: 0 !important;
  }

  .desktop-only-speed,
  .desktop-only-vol,
  .fplayer-vol-wrapper {
    display: none !important; /* Hide speed & volume on mobile to guarantee zero overflow */
  }

  .fplayer-time-display {
    font-size: 0.75rem !important;
    padding: 0 0.25rem !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .fplayer-drawer {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  .fplayer-menu-panel {
    bottom: calc(100% + 12px) !important;
    right: 0 !important;
    left: auto !important;
    transform: translateY(10px) scale(0.96) !important;
    z-index: 60 !important;
  }

  .fplayer-menu-panel.is-open {
    transform: translateY(0) scale(1) !important;
  }
}

@media (max-width: 640px) {
  .fplayer-top-left {
    gap: 0.35rem !important;
  }

  .fplayer-meta-title {
    font-size: 0.95rem !important;
  }

  .fplayer-badge-pill {
    padding: 0 0.55rem !important;
    font-size: 0.72rem !important;
  }

  .fplayer-time-display .total,
  .fplayer-time-display .separator {
    display: none !important; /* Show current time only on phones */
  }

  /* On phones under 480px, hide in-row skip buttons since double-tap handles skip */
  #btnRewind10,
  #btnForward10 {
    display: none !important;
  }

  .fplayer-ctrl-group {
    gap: 0.45rem !important;
  }
}

@media (max-width: 480px) {
  .fplayer-resume-toast {
    top: max(60px, env(safe-area-inset-top, 10px) + 48px) !important;
    width: calc(100% - 20px) !important;
    max-width: 375px !important;
    padding: 0.5rem 0.75rem !important;
    gap: 0.5rem !important;
    border-radius: 12px !important;
  }

  .fplayer-resume-icon {
    width: 28px !important;
    height: 28px !important;
  }

  .fplayer-resume-icon svg {
    width: 14px !important;
    height: 14px !important;
  }

  .fplayer-resume-title {
    font-size: 0.74rem !important;
  }

  .fplayer-resume-detail {
    font-size: 0.68rem !important;
  }

  .fplayer-btn-resume {
    font-size: 0.72rem !important;
    padding: 0.36rem 0.65rem !important;
  }

  .fplayer-btn-restart {
    font-size: 0.68rem !important;
    padding: 0.36rem 0.5rem !important;
  }

  .fplayer-bottom-bar {
    padding: 1rem 0.75rem max(0.75rem, env(safe-area-inset-bottom, 10px)) !important;
  }

  .fplayer-controls-row {
    gap: 0.25rem !important;
  }

  .fplayer-icon-btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
  }
}
