/* ═══════════════════════════════════════════════════════════════
   TMDB Embed Player Styling
   Clean dark theme, glassmorphism, responsive player UI
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Main Accent Theme Color: Netflix Red */
  --primary-color: #e50914;
  --primary-hover: #b9090b;
  --primary-light: #ff3b30;
  --primary-glow: rgba(229, 9, 20, 0.6);
  --primary-bg: rgba(229, 9, 20, 0.2);
  --primary-bg-hover: rgba(229, 9, 20, 0.35);
  --primary-border: rgba(229, 9, 20, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background: #000;
  color: #fff;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* App Loading & Error Screens */
.app-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #090a0f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.app-loading.fade-out {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}

.app-loading-backdrop {
  position: absolute;
  inset: -20px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(8px) brightness(0.55) saturate(1.15);
  transform: scale(1.05);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
}

.app-loading-backdrop.loaded {
  opacity: 1 !important;
}

.app-loading-overlay-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(9, 10, 15, 0.3) 0%, rgba(9, 10, 15, 0.85) 100%),
              linear-gradient(180deg, rgba(9, 10, 15, 0.35) 0%, rgba(9, 10, 15, 0.75) 100%);
}

.app-loading-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  text-align: center;
  max-width: 650px;
}

.app-loading-logo-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  margin-bottom: 6px;
}

.app-loading-logo-img {
  max-width: 320px;
  max-height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.95));
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.app-loading-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffffff;
  text-transform: uppercase;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.9);
  line-height: 1.2;
}

.app-loading-year {
  font-size: 14px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 1px;
  margin-bottom: 24px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.app-loading-progress-track {
  width: 280px;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
  margin-bottom: 22px;
}

.app-loading-progress-bar {
  height: 100%;
  width: 15%;
  background: #ffffff;
  border-radius: 99px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
}

.app-loading-status-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.app-loading-status-primary {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.app-loading-status-secondary {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0.3px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

#app-retry-btn, .ap-retry-btn {
  padding: 10px 22px;
  background: #E50914;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

#app-retry-btn:hover, .ap-retry-btn:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}

/* Player Root */
.player-root {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #000;
}

.ap-player-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

.ap-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.ap-click-area {
  position: absolute;
  inset: 0;
  z-index: 10;
  cursor: pointer;
}

/* Gradients */
.ap-gradient {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 15;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ap-gradient-top {
  top: 0;
  height: 120px;
  background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
}

.ap-gradient-bottom {
  bottom: 0;
  height: 160px;
  background: linear-gradient(0deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
}

/* Controls visibility */
.controls-hidden .ap-gradient,
.controls-hidden .ap-top-bar,
.controls-hidden .ap-controls {
  opacity: 0;
  pointer-events: none;
}

.controls-visible .ap-gradient,
.controls-visible .ap-top-bar,
.controls-visible .ap-controls {
  opacity: 1;
  pointer-events: auto;
}

/* Overlays */
.ap-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  pointer-events: none;
}

.ap-overlay-error {
  pointer-events: auto;
  background: rgba(0,0,0,0.85);
}

.ap-error-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.ap-error-message {
  font-size: 16px;
  color: rgba(255,255,255,0.8);
}

/* Loader Ring */
.ap-loader-ring, .app-loader-ring {
  display: inline-block;
  position: relative;
  width: 48px;
  height: 48px;
}

.ap-loader-ring div, .app-loader-ring div {
  box-sizing: border-box;
  display: block;
  position: absolute;
  width: 38px;
  height: 38px;
  margin: 5px;
  border: 3px solid #E50914;
  border-radius: 50%;
  animation: ap-spinner 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  border-color: #E50914 transparent transparent transparent;
}

.ap-loader-ring div:nth-child(1), .app-loader-ring div:nth-child(1) { animation-delay: -0.45s; }
.ap-loader-ring div:nth-child(2), .app-loader-ring div:nth-child(2) { animation-delay: -0.3s; }
.ap-loader-ring div:nth-child(3), .app-loader-ring div:nth-child(3) { animation-delay: -0.15s; }

@keyframes ap-spinner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Center indicator */
.ap-center-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 22;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.ap-center-indicator.flash {
  animation: ap-flash 0.5s ease-out forwards;
}

@keyframes ap-flash {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.2); }
}

/* Double tap indicator */
.ap-dt-indicator {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 35%;
  z-index: 18;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

.ap-dt-left { left: 0; }
.ap-dt-right { right: 0; }

.ap-dt-indicator.animate {
  animation: ap-dt-fade 0.6s ease-out forwards;
}

.ap-dt-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
}

@keyframes ap-dt-fade {
  0% { opacity: 0; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.1); }
}

/* Top Bar */
.ap-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 25;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: opacity 0.3s ease;
}

.ap-video-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}

.ap-provider-badge {
  padding: 5px 12px;
  background: rgba(229, 9, 20, 0.25);
  border: 1px solid rgba(229, 9, 20, 0.55);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(229, 9, 20, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Stream Guard Notice */
.ap-stream-guard-notice {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  background: rgba(24, 24, 32, 0.9);
  border: 1px solid rgba(255, 77, 79, 0.4);
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  transition: all 0.3s ease;
}

/* Bottom Controls */
.ap-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 25;
  padding: 0 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: opacity 0.3s ease;
}

/* Seek Bar */
.ap-seek-container {
  position: relative;
  width: 100%;
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.ap-seek-track {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  transition: height 0.15s ease;
}

/* Skip Intro / Outro Pill Button (Matching user screenshot) */
.ap-skip-container {
  position: absolute;
  bottom: 85px;
  right: 28px;
  z-index: 85;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.ap-skip-btn {
  background: rgba(40, 40, 40, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.ap-skip-btn:hover {
  background: rgba(60, 60, 60, 0.95);
  border-color: rgba(255, 255, 255, 0.35);
  transform: scale(1.05);
}

.ap-skip-btn:active {
  transform: scale(0.96);
}

/* Yellow Timestamp Markers on Seek Track (Matching reference screenshot) */
.ap-seek-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.ap-seek-marker-segment {
  position: absolute;
  top: 0;
  bottom: 0;
  background: #ffcc00;
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(255, 204, 0, 0.9);
  z-index: 3;
}

.ap-seek-container:hover .ap-seek-track {
  height: 6px;
}

.ap-seek-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: 4px;
}

.ap-seek-buffered {
  background: rgba(255, 255, 255, 0.35);
  width: 0%;
}

.ap-seek-played {
  background: var(--primary-color);
  width: 0%;
  box-shadow: 0 0 8px var(--primary-glow);
}

.ap-seek-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%) scale(0);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
  transition: transform 0.15s ease;
}

.ap-seek-container:hover .ap-seek-thumb {
  transform: translate(-50%, -50%) scale(1);
}

.ap-seek-tooltip {
  position: absolute;
  bottom: 24px;
  left: 0%;
  transform: translateX(-50%);
  background: rgba(15, 15, 20, 0.9);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  white-space: nowrap;
}

.ap-seek-container:hover .ap-seek-tooltip {
  opacity: 1;
}

/* Control Row */
.ap-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.ap-ctrl-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.ap-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.ap-time-display {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  margin-left: 4px;
}

.ap-servers-label {
  font-size: 13px;
  font-weight: 600;
  margin-left: 6px;
}

.ap-btn-servers {
  background: var(--primary-bg);
  border: 1px solid var(--primary-border);
  padding: 5px 12px;
}

.ap-btn-servers:hover {
  background: var(--primary-bg-hover);
}

.ap-speed-label {
  font-size: 13px;
  font-weight: 600;
}

.ap-quality-badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--primary-color);
  color: #fff;
  padding: 2px 5px;
  border-radius: 4px;
  margin-left: 4px;
}

.ap-audio-badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--primary-bg);
  border: 1px solid var(--primary-border);
  color: #fff;
  padding: 2px 5px;
  border-radius: 4px;
  margin-left: 4px;
  text-transform: uppercase;
}

/* Dropdown Menus */
.ap-dropdown-anchor {
  position: relative;
}

.ap-dropdown-menu {
  position: absolute;
  bottom: 42px;
  right: 0;
  background: rgba(18, 18, 26, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px;
  width: 230px;
  max-height: 340px;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.7);
  z-index: 50;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-glow) rgba(255, 255, 255, 0.05);
}

/* Custom Sleek Scrollbar UI System for All Player Menus & Panels */
.ap-dropdown-menu::-webkit-scrollbar,
.ap-menu-options::-webkit-scrollbar,
.ap-settings-panel::-webkit-scrollbar,
.ap-menu-servers::-webkit-scrollbar,
#ap-sub-options::-webkit-scrollbar,
#ap-audio-options::-webkit-scrollbar,
#ap-quality-options::-webkit-scrollbar,
#ap-speed-options::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.ap-dropdown-menu::-webkit-scrollbar-track,
.ap-menu-options::-webkit-scrollbar-track,
.ap-settings-panel::-webkit-scrollbar-track,
.ap-menu-servers::-webkit-scrollbar-track,
#ap-sub-options::-webkit-scrollbar-track,
#ap-audio-options::-webkit-scrollbar-track,
#ap-quality-options::-webkit-scrollbar-track,
#ap-speed-options::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
}

.ap-dropdown-menu::-webkit-scrollbar-thumb,
.ap-menu-options::-webkit-scrollbar-thumb,
.ap-settings-panel::-webkit-scrollbar-thumb,
.ap-menu-servers::-webkit-scrollbar-thumb,
#ap-sub-options::-webkit-scrollbar-thumb,
#ap-audio-options::-webkit-scrollbar-thumb,
#ap-quality-options::-webkit-scrollbar-thumb,
#ap-speed-options::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.55);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.2s ease;
}

.ap-dropdown-menu::-webkit-scrollbar-thumb:hover,
.ap-menu-options::-webkit-scrollbar-thumb:hover,
.ap-settings-panel::-webkit-scrollbar-thumb:hover,
.ap-menu-servers::-webkit-scrollbar-thumb:hover,
#ap-sub-options::-webkit-scrollbar-thumb:hover,
#ap-audio-options::-webkit-scrollbar-thumb:hover,
#ap-quality-options::-webkit-scrollbar-thumb:hover,
#ap-speed-options::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

.ap-menu-servers {
  width: 320px;
  max-height: 400px;
}

.ap-menu-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.45);
  padding: 8px 10px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ap-menu-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ap-menu-option {
  width: 100%;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
}

.ap-menu-option:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary-border);
  color: #fff;
}

.ap-menu-option.active, .ap-menu-option.ap-active {
  background: var(--primary-bg);
  border-color: var(--primary-color);
  color: var(--primary-light);
  font-weight: 600;
  box-shadow: 0 0 10px var(--primary-glow);
}

.ap-server-info-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.ap-server-name-row {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.ap-menu-option.active .ap-server-name-row {
  color: #a5b4fc;
}

.ap-server-audio-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}

.ap-menu-option.active .ap-server-audio-row {
  color: #cbd5e1;
}

.ap-server-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.ap-menu-option.disabled {
  opacity: 0.42;
  filter: grayscale(0.9);
  cursor: not-allowed !important;
  pointer-events: none !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
}

.ap-server-badge.offline {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.ap-menu-option.active .ap-server-badge {
  background: #E50914;
  color: #ffffff;
  border-color: #ff333d;
}

/* Settings Panels */
.ap-settings-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ap-settings-item {
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px;
  cursor: pointer;
}

.ap-settings-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.ap-settings-val {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

.ap-settings-back-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 6px;
}

.ap-settings-back-btn:hover {
  color: #fff;
}

/* Volume Boost Panel inside settings */
.ap-vb-display {
  text-align: center;
  padding: 10px 0 4px;
}

.ap-volboost-value {
  font-size: 24px;
  font-weight: 700;
  color: #818cf8;
}

.ap-vb-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  display: block;
}

.ap-vb-slider-section {
  padding: 8px 12px;
}

.ap-volboost-slider {
  width: 100%;
  accent-color: #E50914;
  cursor: pointer;
}

.ap-vb-presets {
  display: flex;
  gap: 6px;
  padding: 6px 12px 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.ap-vb-chip {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;

}

.ap-vb-chip.active {
  background: #E50914;
  border-color: #E50914;
}

/* Subtitle Display Overlay */
.ap-subtitle-display {
  position: absolute;
  bottom: 105px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 14;
  text-align: center;
  pointer-events: none;
  max-width: 85%;
  font-size: clamp(14px, 2.5vw, 22px);
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.9), 0 0 8px rgba(0,0,0,0.8);
  line-height: 1.18;
  letter-spacing: 0.2px;
}

/* ═══════════════════════════════════════════════════════════════
   Mobile Responsiveness & Touch Optimizations
   ═══════════════════════════════════════════════════════════════ */

button, .ap-ctrl-btn, .ap-click-area, .ap-seek-container, .ap-menu-option {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
  .ap-top-bar {
    padding: 12px 16px;
  }

  .ap-video-title {
    font-size: 14px;
    max-width: 65%;
  }

  .ap-provider-badge {
    font-size: 11px;
    padding: 3px 8px;
  }

  .ap-controls {
    padding: 0 14px 12px;
    gap: 6px;
  }

  .ap-controls-left, .ap-controls-right {
    gap: 6px;
  }

  .ap-ctrl-btn {
    padding: 8px;
    min-width: 36px;
    min-height: 36px;
  }

  .ap-time-display {
    font-size: 11px;
  }

  /* Seek Bar Mobile Touch Optimization */
  .ap-seek-container {
    height: 24px;
  }

  .ap-seek-track {
    height: 5px;
  }

  .ap-seek-thumb {
    width: 16px;
    height: 16px;
    transform: translate(-50%, -50%) scale(1);
  }

  /* Dropdown menus as floating bottom-sheets on mobile */
  .ap-dropdown-menu {
    position: fixed;
    bottom: 60px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: 100vw;
    max-height: 55vh;
    border-radius: 16px;
    background: rgba(14, 14, 22, 0.98);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 12px;
  }

  .ap-menu-servers {
    width: auto;
    max-height: 60vh;
  }

  .ap-menu-option {
    padding: 12px 14px;
    font-size: 14px;
    min-height: 44px;
  }

  .ap-settings-item {
    padding: 12px 14px;
    min-height: 44px;
    font-size: 14px;
  }

  .ap-subtitle-display {
    bottom: 65px;
    max-width: 92%;
    font-size: clamp(13px, 4vw, 18px);
  }
}

@media (max-width: 480px) {
  .ap-servers-label {
    display: none;
  }

  .ap-btn-servers {
    padding: 6px 8px;
  }

  .ap-video-title {
    font-size: 13px;
    max-width: 58%;
  }

  .ap-time-display {
    font-size: 10px;
  }

  .ap-controls-left, .ap-controls-right {
    gap: 4px;
  }

  .ap-btn-rewind, .ap-btn-forward {
    display: none; /* Mobile user can double-tap screen edges */
  }

  .ap-center-indicator {
    width: 60px;
    height: 60px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Subtitle Customization & File Upload Styling
   ═══════════════════════════════════════════════════════════════ */

.ap-sub-upload-btn {
  width: 100%;
  padding: 9px 12px;
  background: rgba(99, 102, 241, 0.2);
  border: 1px dashed rgba(99, 102, 241, 0.5);
  border-radius: 8px;
  color: #a5b4fc;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.ap-sub-upload-btn:hover {
  background: rgba(229, 9, 20, 0.35);
  color: #fff;
  border-color: #E50914;
}

.ap-sub-style-section {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ap-sub-style-section:last-child {
  border-bottom: none;
}

.ap-sub-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.5);
  display: block;
  margin-bottom: 6px;
}

.ap-sub-color-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ap-sub-color-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.ap-sub-color-btn:hover {
  transform: scale(1.15);
}

.ap-sub-color-btn.active {
  border-color: #E50914;
  box-shadow: 0 0 8px rgba(229, 9, 20, 0.8);
}

.ap-sub-chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ap-sub-size-btn, .ap-sub-pos-btn, .ap-sub-bg-btn, .ap-sub-offset-btn {
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ap-sub-size-btn:hover, .ap-sub-pos-btn:hover, .ap-sub-bg-btn:hover, .ap-sub-offset-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.ap-sub-size-btn.active, .ap-sub-pos-btn.active, .ap-sub-bg-btn.active {
  background: #E50914;
  border-color: #E50914;
  color: #fff;
  font-weight: 600;
}

video::cue {
  background: transparent;
  color: #ffffff;
  font-family: inherit;
  font-size: 18px;
  line-height: 1.18;
  text-shadow: 0 2px 4px rgba(0,0,0,0.9), 0 0 8px rgba(0,0,0,0.8);
}


