/* ==========================================================================
   PikPak & Jellyfin Headless Web Player - Custom Cinema Styles
   ========================================================================== */

:root {
  --bg-deep: #090a0f;
  --bg-card: #12141c;
  --bg-hover: #1b1e2b;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(255, 255, 255, 0.2);
  --primary-accent: #3b82f6;
  --accent-gold: #f59e0b;
  --accent-purple: #8b5cf6;
  --accent-emerald: #10b981;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(10, 11, 16, 0.7);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Ambient Glow Layer */
.ambient-glow-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 70vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  opacity: 0.45;
  transition: opacity 1s ease, filter 1s ease;
}

.ambient-glow-bg {
  position: absolute;
  top: -20%;
  left: -10%;
  width: 120%;
  height: 140%;
  background-size: cover;
  background-position: center;
  filter: blur(80px) saturate(160%);
  transform: translateZ(0);
  transition: background-image 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Glassmorphism Classes */
.glass-panel {
  background: rgba(18, 20, 28, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
}

.glass-dropdown {
  background: rgba(15, 17, 24, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
}

/* Media Card Hover & Animations */
.media-card {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
  will-change: transform;
}

.media-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.8), 0 0 25px 0 rgba(59, 130, 246, 0.2);
  border-color: rgba(96, 165, 250, 0.4);
}

.media-card:hover .poster-overlay {
  opacity: 1;
}

.media-card:hover .play-hover-btn {
  transform: scale(1);
  opacity: 1;
}

/* Tech Badges */
.badge-4k {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #000;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.badge-ltx {
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.35);
}

.badge-sub {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.4);
}

.badge-hevc {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.4);
}

.badge-rating {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

/* Hero Carousel Backdrop Gradient Mask */
.hero-mask {
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 100%);
}

.hero-radial-mask {
  mask-image: radial-gradient(circle at 75% 35%, black 40%, transparent 85%);
  -webkit-mask-image: radial-gradient(circle at 75% 35%, black 40%, transparent 85%);
}

/* Pulsing Status Dot */
@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.pulsing-green {
  animation: pulse-dot 2s infinite;
}

/* Video Player Subtitle Styling */
::cue {
  background-color: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 1.25rem;
  line-height: 1.4;
  border-radius: 4px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.9);
}

/* Drawer & Modal Transitions */
.drawer-backdrop {
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-content {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Shimmer Loading Effect */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, #181b24 25%, #252a38 50%, #181b24 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
}


/* ==========================================================================
   Flagship V2: Jable-style Player, Actress Cosmos & Subtitle Controls
   ========================================================================== */

/* Jable-style Ultra-thin Progress Scrub Bar */
.scrub-container {
  position: relative;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  cursor: pointer;
  transition: height 0.15s ease;
}

.scrub-container:hover {
  height: 10px;
}

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

.scrub-played {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #ec4899);
  border-radius: 9999px;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.6);
}

.scrub-thumb {
  position: absolute;
  top: 50%;
  right: -6px;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-radius: 9999px;
  transform: translateY(-50%) scale(0);
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 8px rgba(0,0,0,0.8);
}

.scrub-container:hover .scrub-thumb {
  transform: translateY(-50%) scale(1);
}

.scrub-tooltip {
  position: absolute;
  bottom: 22px;
  transform: translateX(-50%);
  background: rgba(10, 12, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-family: monospace;
  pointer-events: none;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.scrub-container:hover .scrub-tooltip {
  opacity: 1;
}

/* Double-click Tap Ripple (Jable/YouTube style 10s seek) */
.tap-ripple {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 35%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 35;
}

.tap-ripple.active {
  opacity: 1;
  animation: tap-fade 0.75s ease-out forwards;
}

@keyframes tap-fade {
  0% { transform: scale(0.9); opacity: 0.9; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}

/* Subtitle Style Presets */
.sub-preset-white {
  color: #ffffff !important;
  text-shadow: 0 2px 4px rgba(0,0,0,0.9), 0 0 2px #000, 0 0 4px #000 !important;
  background-color: transparent !important;
}

.sub-preset-yellow {
  color: #fbbf24 !important;
  text-shadow: 0 2px 4px rgba(0,0,0,0.95), 0 0 3px #000 !important;
  background-color: transparent !important;
}

.sub-preset-emerald {
  color: #34d399 !important;
  background-color: rgba(0, 0, 0, 0.82) !important;
  padding: 4px 12px !important;
  border-radius: 6px !important;
}

/* Subtitle Font Size Classes */
.sub-size-sm { font-size: 1.1rem !important; }
.sub-size-md { font-size: 1.35rem !important; }
.sub-size-lg { font-size: 1.65rem !important; }
.sub-size-xl { font-size: 2.1rem !important; }

/* Resume Playback Toast Card */
.resume-playback-card {
  animation: slide-up-card 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slide-up-card {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Series Badge Tag */
.badge-series {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.35);
  font-family: monospace;
}
