/* ===================================================================
   WESLAPLAY — Clean, High-End Tesla In-Car Dark Mode UI
   Optimized for Tesla Touchscreens (Model 3, Y, S, X & Cybertruck)
   =================================================================== */

:root {
  --bg-main: #0a0b0e;
  --bg-card: #13151b;
  --bg-card-hover: #191c25;
  --bg-surface: #181b23;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(255, 255, 255, 0.16);
  --text-primary: #ffffff;
  --text-secondary: #9aa0a6;
  --text-muted: #60646c;
  --tesla-red: #e82127;
  --tesla-red-hover: #ff2b32;
  --netflix-red: #e50914;
  --plex-amber: #e5a00d;
  --accent-blue: #007aff;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.75);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ===================================================================
   App Header
   =================================================================== */

.app-header {
  background: rgba(13, 14, 18, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(232, 33, 39, 0.2), rgba(232, 33, 39, 0.05));
  border: 1px solid rgba(232, 33, 39, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tesla-red);
}

.tesla-icon {
  width: 24px;
  height: 24px;
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff, #dcdcdc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  background: var(--bg-surface);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  gap: 4px;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  background: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.35);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 50px;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent-blue);
  color: #ffffff;
}

.btn-primary:hover {
  background: #1a8cff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-theater-sm {
  background: rgba(232, 33, 39, 0.12);
  border: 1px solid rgba(232, 33, 39, 0.3);
  color: #ff6b70;
  font-size: 13px;
  padding: 8px 16px;
  min-height: 42px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
}

.btn-theater-sm:hover {
  background: rgba(232, 33, 39, 0.2);
  color: #ffffff;
}

.btn-launch {
  width: 100%;
  font-size: 17px;
  padding: 16px;
  border-radius: var(--radius-md);
}

.btn-plex-color {
  background: linear-gradient(135deg, #e5a00d, #b87e05);
  color: #ffffff;
}

.btn-plex-color:hover {
  background: linear-gradient(135deg, #f5b01d, #e5a00d);
}

.btn-netflix-color {
  background: linear-gradient(135deg, #e50914, #b20710);
  color: #ffffff;
}

.btn-netflix-color:hover {
  background: linear-gradient(135deg, #ff1a25, #e50914);
}

/* ===================================================================
   Main Content Layout
   =================================================================== */

.app-container {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.tab-pane.active {
  display: flex;
}

/* Status Banner */
.status-banner {
  background: rgba(52, 199, 89, 0.08);
  border: 1px solid rgba(52, 199, 89, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot-live {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 10px #34c759;
}

.status-label {
  font-size: 13px;
  font-weight: 700;
  color: #34c759;
}

.status-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===================================================================
   YouTube In-Browser Player
   =================================================================== */

.player-stage {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.3s ease;
}

.tab-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.search-toolbar {
  display: flex;
  gap: 10px;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 16px;
  font-size: 16px;
  opacity: 0.5;
  pointer-events: none;
}

.search-input-wrapper input {
  width: 100%;
  height: 50px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 44px 0 46px;
  color: #ffffff;
  font-size: 15px;
  outline: none;
}

.search-input-wrapper input:focus {
  border-color: var(--accent-blue);
}

.btn-clear {
  position: absolute;
  right: 14px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  cursor: pointer;
}

.video-player-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 ratio */
  height: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000000;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
}

.video-player-container canvas,
.mjpeg-stream-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000000;
  z-index: 2;
}

.player-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 11, 14, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  z-index: 10;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.unmute-floating-badge {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(232, 33, 39, 0.95), rgba(180, 20, 25, 0.95));
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  z-index: 15;
  box-shadow: 0 4px 20px rgba(232, 33, 39, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.2);
  animation: pulse-badge 2s ease-in-out infinite;
  backdrop-filter: blur(8px);
  user-select: none;
  transition: transform 0.15s ease, background 0.15s ease;
}

.unmute-floating-badge:hover,
.unmute-floating-badge:active {
  transform: translateX(-50%) scale(1.05);
  background: linear-gradient(135deg, #ff2a30, #e82127);
}

.unmute-floating-badge .unmute-icon {
  font-size: 17px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

@keyframes pulse-badge {
  0%, 100% {
    transform: translateX(-50%) scale(1);
    box-shadow: 0 4px 20px rgba(232, 33, 39, 0.5);
  }
  50% {
    transform: translateX(-50%) scale(1.04);
    box-shadow: 0 6px 26px rgba(232, 33, 39, 0.85);
  }
}

.canvas-controls {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 5;
  background: rgba(0, 0, 0, 0.6);
  padding: 6px;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
}

.control-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.presets-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.presets-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.preset-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 9px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 40px;
}

.preset-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.preset-chip.active {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #ffffff;
}

/* Now Playing Info Bar */
.now-playing-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
}

.now-playing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3b30;
  box-shadow: 0 0 8px #ff3b30;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}

.now-playing-label {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.now-playing-title {
  color: #ffffff;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Search Results Grid */
.search-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 6px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

.search-result-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.search-result-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-red);
}

.search-result-thumb-box {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
}

.search-result-thumb-box img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-result-duration {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.search-result-meta {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-result-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-channel {
  font-size: 11px;
  color: var(--text-muted);
}


/* ===================================================================
   Plex & Netflix Panels
   =================================================================== */

.service-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.panel-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  flex-shrink: 0;
}

.panel-icon svg {
  width: 30px;
  height: 30px;
}

.plex-icon {
  background: rgba(229, 160, 13, 0.15);
  color: var(--plex-amber);
  border: 1px solid rgba(229, 160, 13, 0.3);
}

.netflix-icon {
  background: rgba(229, 9, 20, 0.15);
  color: var(--netflix-red);
  border: 1px solid rgba(229, 9, 20, 0.3);
}

.panel-header h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 2px;
}

.panel-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

.server-config-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.server-config-card label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-row {
  display: flex;
  gap: 8px;
}

.input-row input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: #ffffff;
  font-size: 14px;
  outline: none;
  min-height: 48px;
}

.field-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.netflix-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
}

.feat-icon {
  font-size: 22px;
  display: block;
  margin-bottom: 8px;
}

.feature-card h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.feature-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Footer */
.app-footer {
  margin-top: 10px;
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 13px;
}

.btn-link {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  text-decoration: underline;
  cursor: pointer;
  font-size: 12px;
}

.btn-link:hover {
  color: #ffffff;
}

/* ===================================================================
   Safety Modal
   =================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}

.modal-backdrop.show {
  display: flex;
}

.modal-card {
  background: #141720;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  max-width: 500px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.modal-badge {
  display: inline-block;
  background: rgba(255, 149, 0, 0.2);
  color: #ffaa33;
  border: 1px solid rgba(255, 149, 0, 0.4);
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.modal-card h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 12px;
}

.modal-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.checkbox-container {
  background: rgba(255, 255, 255, 0.04);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  text-align: left;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.custom-checkbox input {
  display: none;
}

.checkmark {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-highlight);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.custom-checkbox input:checked + .checkmark {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.custom-checkbox input:checked + .checkmark::after {
  content: '✓';
  color: #ffffff;
  font-size: 14px;
  font-weight: bold;
}

.label-text {
  font-size: 14px;
  font-weight: 600;
}

.modal-actions {
  display: flex;
}

.modal-actions .btn {
  flex: 1;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===================================================================
   Free Cinema & Archive Movies Tab
   =================================================================== */

.cinema-search-bar .search-icon {
  font-size: 18px;
}

/* Genre Filter Chips */
.genre-filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.genre-filter-row::-webkit-scrollbar {
  display: none;
}

.genre-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 9px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.genre-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.genre-chip.active {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.35);
}

/* Featured Hero Spotlight */
.cinema-featured-card {
  position: relative;
  background: linear-gradient(135deg, rgba(232, 33, 39, 0.14) 0%, rgba(20, 23, 33, 0.95) 60%), #141720;
  border: 1px solid rgba(232, 33, 39, 0.3);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

.featured-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(232, 33, 39, 0.2);
  color: #ff5258;
  border: 1px solid rgba(232, 33, 39, 0.4);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  width: fit-content;
}

.featured-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.featured-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.meta-tag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}

.featured-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 780px;
}

.featured-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.btn-cinema-watch {
  background: linear-gradient(135deg, #e82127, #c4181e);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(232, 33, 39, 0.4);
  font-size: 15px;
}

.btn-cinema-watch:hover {
  background: linear-gradient(135deg, #ff2b32, #e82127);
  box-shadow: 0 6px 20px rgba(232, 33, 39, 0.6);
}

/* Section Header */
.cinema-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}

.cinema-section-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.cinema-count-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
}

/* Movies Catalog Grid */
.movies-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.movie-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.movie-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
}

.movie-card:active {
  transform: scale(0.98);
}

.movie-card.now-playing {
  border-color: var(--tesla-red);
  box-shadow: 0 0 16px rgba(232, 33, 39, 0.45);
}

.movie-poster-box {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  background: #141720;
  overflow: hidden;
}

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

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

.movie-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.movie-card:hover .movie-play-overlay {
  opacity: 1;
}

.play-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--tesla-red);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 20px;
  box-shadow: 0 4px 14px rgba(232, 33, 39, 0.6);
}

.movie-badge-genre {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(10, 11, 14, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.movie-badge-runtime {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(10, 11, 14, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #34c759;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid rgba(52, 199, 89, 0.3);
}

.movie-meta-box {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.movie-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.movie-synopsis {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-empty-state {
  grid-column: 1 / -1;
  padding: 36px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ===================================================================
   Live Cams & 24/7 News Tab
   =================================================================== */

.live-category-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 9px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.live-category-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.live-category-chip.active {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.35);
}

.live-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(232, 33, 39, 0.2);
  color: #ff5258;
  border: 1px solid rgba(232, 33, 39, 0.4);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  width: fit-content;
}

.live-dot-pulse {
  width: 8px;
  height: 8px;
  background: #e82127;
  border-radius: 50%;
  animation: live-pulse-glow 1.5s infinite;
}

@keyframes live-pulse-glow {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(232, 33, 39, 0.8); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 7px rgba(232, 33, 39, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(232, 33, 39, 0); }
}

.live-feeds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.live-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.live-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
}

.live-card:active {
  transform: scale(0.98);
}

.live-card.now-playing {
  border-color: var(--tesla-red);
  box-shadow: 0 0 16px rgba(232, 33, 39, 0.45);
}

.live-card-thumb-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #12141c;
  overflow: hidden;
}

.live-card-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.live-card:hover .live-card-thumb-box img {
  transform: scale(1.04);
}

.live-badge-status {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(10, 11, 14, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ff3b30;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 59, 48, 0.4);
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-badge-category {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(10, 11, 14, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.live-card-meta-box {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.live-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
}

.live-card-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 800px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
  }
  .nav-tabs {
    overflow-x: auto;
  }
  .search-toolbar {
    flex-direction: column;
  }
}
