/* ==========================================================================
   Alcatraz Web Player - Cinema Streaming Stylesheet
   Standards: WCAG 2.1 Level AA Compliant
   Design: Modern Dark Glassmorphic Cinema UI, Vibrant Accents, Zero Inline Styles
   ========================================================================== */

:root {
  /* Color Tokens */
  --bg-deep: #060911;
  --bg-surface: #0c121e;
  --bg-card: rgba(16, 24, 40, 0.75);
  --bg-card-hover: rgba(26, 38, 64, 0.85);
  --bg-card-active: rgba(59, 130, 246, 0.15);
  --bg-overlay: rgba(6, 9, 17, 0.85);

  /* Primary & Accent Palettes */
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.4);
  --accent-cyan: #06b6d4;
  --accent-cyan-hover: #0891b2;
  --accent-gold: #f59e0b;
  --accent-gold-dark: #d97706;
  --success: #10b981;
  --danger: #ef4444;

  /* High Contrast Typography Tokens (WCAG 2.1 AA) */
  --text-main: #f8fafc;       /* 15:1 contrast against --bg-surface */
  --text-muted: #94a3b8;      /* 4.8:1 contrast against --bg-surface */
  --text-dim: #64748b;
  --text-primary: #60a5fa;

  /* Borders & Dividers */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-focus: #3b82f6;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', var(--font-sans);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 8px 36px rgba(0, 0, 0, 0.75);
  --shadow-glow: 0 0 24px var(--primary-glow);

  /* Dimensions */
  --header-height: 64px;
  --sidebar-width: 290px;
}

/* ==========================================================================
   CSS Reset & Accessibility Foundation
   ========================================================================== */

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

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
}

/* Accessible Focus Outlines (WCAG 2.4.7) */
*:focus {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.is-hidden {
  display: none !important;
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  background: var(--primary);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 99999;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus-visible {
  top: 16px;
}

/* Ambient Background Glow */
.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.22;
}

.orb-primary {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #2563eb, #1e3a8a);
  top: -150px;
  left: 20%;
}

.orb-accent {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, #06b6d4, #0e7490);
  bottom: -150px;
  right: 15%;
}

/* ==========================================================================
   Header Component
   ========================================================================== */

.player-header {
  position: relative;
  z-index: 50;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(12, 18, 30, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo {
  filter: drop-shadow(0 2px 8px var(--primary-glow));
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-sub {
  color: var(--primary);
  font-weight: 600;
  margin-left: 2px;
}

.badge-browser {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Mode Navigation Tabs */
.player-modes-nav {
  display: flex;
  align-items: center;
  background: rgba(18, 26, 44, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 4px;
}

.mode-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.mode-tab-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), #2563eb);
  box-shadow: 0 2px 12px var(--primary-glow);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.slot-select-custom {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(20, 28, 46, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 10px;
  transition: border-color 0.2s ease;
}

.slot-select-custom:focus-within {
  border-color: var(--border-focus);
}

.slot-prefix {
  color: var(--primary);
  display: flex;
  align-items: center;
  margin-right: 6px;
}

.slot-select-input {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 4px;
  cursor: pointer;
}

.slot-select-input option {
  background-color: #0c121e;
  color: var(--text-main);
}

.header-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 180px;
  background: rgba(20, 28, 46, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 7px 12px 7px 32px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  transition: all 0.25s ease;
}

.search-input:focus {
  width: 240px;
  border-color: var(--border-focus);
  background: rgba(26, 36, 60, 0.95);
}

.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-dim);
  pointer-events: none;
}

.btn-account-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-account-link:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.account-email {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* ==========================================================
   Layout Structure
   ========================================================== */

.player-layout {
  position: relative;
  z-index: 10;
  display: flex;
  height: calc(100vh - var(--header-height));
  overflow: hidden;
}

/* Left Sidebar: Categories */
.categories-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: rgba(12, 18, 30, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px 18px;
}

.sidebar-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sidebar-count {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

.category-search-wrap {
  padding: 0 16px 12px 16px;
}

.category-search-input {
  width: 100%;
  padding: 8px 12px;
  background: rgba(20, 28, 46, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  transition: border-color 0.2s ease;
}

.category-search-input:focus {
  border-color: var(--border-focus);
}

.categories-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Category Item Button */
.category-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.category-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.category-btn.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.35);
  color: #ffffff;
  font-weight: 600;
}

.category-btn.active .category-badge {
  background: var(--primary);
  color: #ffffff;
}

.category-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 8px;
}

.category-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  flex-shrink: 0;
}

/* Main Content Stage */
.main-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ==========================================================
   Cinema Video Player Section
   ========================================================== */

.cinema-player-section {
  position: relative;
  width: 100%;
  background: #000000;
  flex-shrink: 0;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
  border-bottom: 1px solid var(--border);
  max-height: 520px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.3s ease,
              border-bottom-color 0.3s ease;
}

/* Expanded Grid Mode: folds cinema player upwards */
.main-stage.content-expanded .cinema-player-section {
  max-height: 0;
  opacity: 0;
  border-bottom-color: transparent;
  box-shadow: none;
  pointer-events: none;
}

/* ==========================================================
   Browser-Vollbild (Fensterfüllend ohne OS-Fullscreen)
   ========================================================== */
body.web-fullscreen {
  overflow: hidden !important;
}

body.web-fullscreen .player-header,
body.web-fullscreen .sidebar-categories,
body.web-fullscreen .content-view-section {
  display: none !important;
}

body.web-fullscreen .main-stage {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 99999 !important;
}

body.web-fullscreen .cinema-player-section {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  z-index: 99999 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  opacity: 1 !important;
  background: #000000 !important;
}

body.web-fullscreen .video-container {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.web-fullscreen .main-video {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

.video-container {
  position: relative;
  width: 100%;
  max-width: 1400px;
  height: 480px;
  margin: 0 auto;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

/* Player Overlays (Spinner & Error) */
.player-overlay-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 20;
}

.spinner-ring {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.spinner-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: #e2e8f0;
}

.player-overlay-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: rgba(10, 14, 24, 0.9);
  backdrop-filter: blur(8px);
  z-index: 25;
}

.error-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 14px;
  color: #f87171;
}

.error-desc {
  color: var(--text-muted);
  max-width: 460px;
  font-size: 0.9rem;
  margin: 8px 0 18px 0;
}

/* Video Controls Overlay */
.video-controls-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.2) 25%, transparent 50%);
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 15;
}

.video-container:hover .video-controls-overlay,
.video-container:focus-within .video-controls-overlay {
  opacity: 1;
}

/* Scrubber for VOD/Series */
.controls-scrubber-wrap {
  position: relative;
  padding: 0 20px;
  margin-bottom: 6px;
}

.scrubber-slider {
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  appearance: none;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  cursor: pointer;
}

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

.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 14px 20px;
}

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

.controls-center {
  flex: 1;
  text-align: center;
  padding: 0 20px;
  overflow: hidden;
}

.stream-playing-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  max-width: 100%;
}

.ctrl-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: transform 0.15s ease, color 0.15s ease;
}

.ctrl-btn:hover {
  color: var(--primary);
  transform: scale(1.1);
}

.live-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.live-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.volume-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.volume-slider {
  width: 70px;
  height: 4px;
  accent-color: var(--primary);
  cursor: pointer;
}

.time-display {
  font-size: 0.82rem;
  font-family: var(--font-mono, monospace);
  color: var(--text-muted);
}

/* Audio Tracks Menu */
.audio-track-wrap {
  position: relative;
}

.audio-track-menu {
  position: absolute;
  bottom: 40px;
  right: 0;
  min-width: 160px;
  background: rgba(14, 21, 35, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.audio-track-item {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
}

.audio-track-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.audio-track-item.active {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  font-weight: 600;
}

/* ==========================================================
   Content Views Section
   ========================================================== */

.content-view-section {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 40px 24px;
}

.content-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
}

.toolbar-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-toggle-expand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: rgba(20, 28, 46, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-toggle-expand:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.55);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
}

.btn-toggle-expand:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-toggle-expand.is-expanded {
  background: rgba(59, 130, 246, 0.28);
  border-color: var(--primary);
  color: #93c5fd;
  box-shadow: 0 0 16px var(--primary-glow);
}

.btn-toggle-expand svg {
  flex-shrink: 0;
  color: var(--primary);
  transition: transform 0.25s ease;
}

.btn-toggle-expand:hover svg,
.btn-toggle-expand.is-expanded svg {
  color: #ffffff;
}

.current-category-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.content-count-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

/* Channels List Grid */
.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.channel-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  text-align: left;
}

.channel-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.channel-card.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
}

.channel-logo-wrap {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.channel-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.channel-logo-fallback {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.channel-info-meta {
  flex: 1;
  min-width: 0;
}

.channel-name {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.channel-epg {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-card.active .channel-name {
  color: #60a5fa;
}

/* ==========================================================
   Poster Grid for Movies & Series
   ========================================================== */

.media-poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
}

.poster-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.poster-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.poster-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  background: #090e18;
  overflow: hidden;
}

.poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.poster-card:hover .poster-img {
  transform: scale(1.05);
}

.poster-badge-rating {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.poster-meta {
  padding: 10px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.poster-title {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.poster-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ==========================================================
   Modals & Dialogs
   ========================================================== */

.modal-dialog {
  border: none;
  background: transparent;
  padding: 0;
  margin: auto;
  max-width: 900px;
  width: 90vw;
  max-height: 90vh;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.modal-dialog::backdrop {
  background: rgba(4, 7, 14, 0.85);
  backdrop-filter: blur(12px);
}

.modal-content {
  position: relative;
  background: #0f172a;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: var(--text-main);
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 30;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.8);
  transform: rotate(90deg);
}

/* Movie Detail Modal */
.movie-backdrop-hero {
  position: relative;
  width: 100%;
  height: 280px;
  background-size: cover;
  background-position: center top;
  background-color: #0b1120;
}

.backdrop-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #0f172a 5%, rgba(15, 23, 42, 0.4) 60%, rgba(15, 23, 42, 0.8) 100%);
}

.movie-detail-body {
  position: relative;
  display: flex;
  gap: 28px;
  padding: 0 32px 36px 32px;
  margin-top: -120px;
  z-index: 10;
}

.movie-poster-col {
  width: 180px;
  flex-shrink: 0;
}

.movie-detail-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8);
}

.movie-info-col {
  flex: 1;
  padding-top: 60px;
}

.movie-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.chip-rating {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.chip-year,
.chip-duration,
.chip-genre {
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.movie-detail-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.movie-detail-plot {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #cbd5e1;
  margin-bottom: 20px;
}

.movie-credits {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.credit-label {
  color: var(--text-dim);
  font-weight: 600;
  margin-right: 6px;
}

.credit-val {
  color: var(--text-main);
}

.btn-play-large {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 20px var(--primary-glow);
}

/* Series Modal */
.modal-series-content {
  padding: 32px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.series-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.series-plot {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.season-tabs-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.season-tab-btn {
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.season-tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.season-tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.episodes-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.episode-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.episode-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(59, 130, 246, 0.4);
}

.episode-meta-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.episode-num {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 32px;
}

.episode-title {
  font-weight: 600;
  font-size: 0.95rem;
}

/* Auth / Login Modal */
.modal-auth-content {
  padding: 40px 36px;
  max-width: 440px;
  margin: 0 auto;
  text-align: center;
}

.auth-brand-logo {
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 16px var(--primary-glow));
}

.auth-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.web-login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e2e8f0;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  background: rgba(20, 28, 46, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  transition: all 0.2s ease;
}

.form-input:focus {
  border-color: var(--border-focus);
  background: rgba(26, 36, 60, 0.95);
}

.btn-block {
  width: 100%;
  justify-content: center;
  padding: 12px;
  margin-top: 8px;
}

.auth-footer-notes {
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.auth-footer-notes a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer-notes a:hover {
  text-decoration: underline;
}

/* Unconfigured Slot Modal */
.modal-unconfigured-content {
  padding: 36px 32px;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}

.unconfigured-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px auto;
}

.unconfigured-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.unconfigured-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 24px;
}

/* ==========================================================
   Buttons & General Components
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #2563eb);
  color: #ffffff;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.82rem;
}

.alert-inline {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  margin-bottom: 14px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  text-align: left;
}

/* Skeleton Loading Animation */
.category-skeleton {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
}

.skeleton-line {
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ==========================================================
   Responsive Adaptations
   ========================================================== */

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 240px;
  }
  .video-container {
    height: 380px;
  }
}

@media (max-width: 768px) {
  .player-layout {
    flex-direction: column;
  }
  .categories-sidebar {
    width: 100%;
    height: 180px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .video-container {
    height: 280px;
  }
  .header-brand-group .badge-browser,
  .btn-account-link .account-email {
    display: none;
  }
  .movie-detail-body {
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: -60px;
  }
  .movie-info-col {
    padding-top: 10px;
  }
}
