/* ============================================================
   دلال تايم - Dalal Time Streaming App Styles
   ============================================================ */

/* --- CSS Variables --- */
:root {
  --bg-primary: #1a0a2e;
  --bg-secondary: #130822;
  --bg-card: #2d1b4e;
  --bg-card-hover: #3a2563;
  --bg-surface: #241540;
  --bg-overlay: rgba(26, 10, 46, 0.92);
  --gold: #f5c518;
  --gold-dark: #d4a80e;
  --gold-light: #ffe066;
  --purple: #8b5cf6;
  --purple-light: #a78bfa;
  --purple-dark: #6d28d9;
  --text-primary: #f0e6ff;
  --text-secondary: #b8a5d6;
  --text-muted: #7c6a9a;
  --text-on-gold: #1a0a2e;
  --border-color: rgba(139, 92, 246, 0.2);
  --border-focus: #f5c518;
  --shadow-card: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-hover: 0 8px 40px rgba(139, 92, 246, 0.3);
  --shadow-glow: 0 0 30px rgba(245, 197, 24, 0.3);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  --header-height: 70px;
  --font-family: 'Cairo', sans-serif;
  --z-header: 100;
  --z-overlay: 200;
  --z-player: 300;
  --z-toast: 400;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  direction: rtl;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
input, select, textarea { font-family: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--purple-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple); }

/* --- Focus Management (TV Remote) --- */
[data-focusable]:focus,
[data-focusable]:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
  z-index: 10;
}

.focus-ring {
  outline: 3px solid var(--border-focus) !important;
  outline-offset: 4px !important;
  box-shadow: var(--shadow-glow) !important;
}

/* --- Header --- */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: linear-gradient(180deg, var(--bg-primary) 0%, rgba(26,10,46,0.95) 60%, transparent 100%);
  z-index: var(--z-header);
  transition: background var(--transition-normal);
}

.app-header.scrolled {
  background: var(--bg-overlay);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  max-width: 1920px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 40px;
  gap: 30px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
}

.logo-icon {
  font-size: 28px;
}

.logo-text {
  font-size: 28px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-xl);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.15);
}

.nav-link.active {
  color: var(--gold);
  background: rgba(245, 197, 24, 0.12);
}

.nav-icon {
  width: 20px;
  height: 20px;
}

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

/* --- Search --- */
.search-container {
  position: relative;
}

.search-toggle {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--transition-fast);
  padding: 8px;
}

.search-toggle svg {
  width: 22px;
  height: 22px;
}

.search-toggle:hover { background: rgba(139, 92, 246, 0.2); }

.search-box {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 0;
  opacity: 0;
  overflow: hidden;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 2px solid var(--purple);
  border-radius: var(--radius-xl);
}

.search-box.open {
  width: 400px;
  opacity: 1;
}

.search-box input {
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
  border-radius: 50%;
}

.search-close:hover { color: var(--text-primary); }

.search-results-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  margin-top: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-height: 400px;
  overflow-y: auto;
  display: none;
  box-shadow: var(--shadow-card);
  z-index: 10;
}

.search-results-dropdown.visible { display: block; }

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.search-result-item:hover,
.search-result-item:focus {
  background: rgba(139, 92, 246, 0.15);
}

.search-result-item img {
  width: 45px;
  height: 65px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.search-no-results {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* --- Main Content --- */
.app-main {
  min-height: 100vh;
  padding-top: var(--header-height);
}

/* --- Page Loading --- */
.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.page-loading.hidden { display: none; }

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* --- Page Transitions --- */
.page-enter {
  animation: pageIn 0.4s ease forwards;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(15px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Hero Banner --- */
.hero-banner {
  position: relative;
  width: 100%;
  height: 75vh;
  min-height: 500px;
  max-height: 800px;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
}

.hero-slide.active { opacity: 1; }

.hero-backdrop {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, var(--bg-primary) 0%, transparent 50%),
    linear-gradient(90deg, var(--bg-primary) 0%, transparent 60%);
}

.hero-content {
  position: absolute;
  bottom: 80px;
  right: 60px;
  max-width: 600px;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  background: var(--gold);
  color: var(--text-on-gold);
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-xl);
  margin-bottom: 14px;
}

.hero-title {
  font-size: 48px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 8px;
  text-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  font-size: 15px;
  color: var(--text-secondary);
}

.hero-meta .rating { color: var(--gold); font-weight: 700; }

.hero-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius-xl);
  transition: all var(--transition-fast);
  white-space: nowrap;
  min-height: 52px;
}

.btn-primary {
  background: var(--gold);
  color: var(--text-on-gold);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--gold-light);
  box-shadow: var(--shadow-glow);
  transform: scale(1.03);
}

.btn-secondary {
  background: rgba(255,255,255,0.12);
  color: var(--text-primary);
  backdrop-filter: blur(10px);
}
.btn-secondary:hover, .btn-secondary:focus {
  background: rgba(255,255,255,0.2);
  transform: scale(1.03);
}

.btn svg {
  width: 22px;
  height: 22px;
}

.hero-dots {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 2;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}

.hero-dot.active {
  background: var(--gold);
  width: 28px;
  border-radius: 5px;
}

/* --- Content Row --- */
.content-section {
  padding: 20px 40px 30px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-title {
  font-size: 24px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 26px;
  background: var(--gold);
  border-radius: 2px;
}

.section-more {
  font-size: 14px;
  font-weight: 600;
  color: var(--purple-light);
  padding: 8px 16px;
  border-radius: var(--radius-xl);
  transition: all var(--transition-fast);
}

.section-more:hover { background: rgba(139,92,246,0.15); }

/* --- Scrollable Row --- */
.scroll-row-wrapper {
  position: relative;
}

.scroll-row {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 8px 0 20px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scroll-row::-webkit-scrollbar { display: none; }

.scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-overlay);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  opacity: 0;
  transition: all var(--transition-fast);
}

.scroll-arrow svg { width: 24px; height: 24px; }
.scroll-arrow.arrow-left { left: -10px; }
.scroll-arrow.arrow-right { right: -10px; }
.scroll-row-wrapper:hover .scroll-arrow { opacity: 1; }
.scroll-arrow:hover { background: var(--purple-dark); }

/* --- Movie Card --- */
.movie-card {
  flex-shrink: 0;
  width: 200px;
  cursor: pointer;
  scroll-snap-align: start;
  border-radius: var(--radius-md);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
}

.movie-card:hover,
.movie-card:focus-within {
  transform: scale(1.08);
  z-index: 5;
}

.movie-card-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
}

.movie-card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

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

.movie-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-normal);
  border-radius: var(--radius-md);
}

.movie-card:hover .movie-card-overlay,
.movie-card:focus-within .movie-card-overlay {
  opacity: 1;
}

.movie-card-play {
  width: 52px;
  height: 52px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
  transition: transform var(--transition-fast);
}

.movie-card-play svg {
  width: 24px;
  height: 24px;
  fill: var(--text-on-gold);
  margin-right: -2px;
}

.movie-card:hover .movie-card-play { transform: scale(1.1); }

.card-quality-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  background: var(--gold);
  color: var(--text-on-gold);
}

.movie-card-info {
  padding: 10px 4px 4px;
}

.movie-card-title {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.movie-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.movie-card-rating {
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--gold);
  font-weight: 600;
}

.movie-card-rating svg {
  width: 12px;
  height: 12px;
  fill: var(--gold);
}

/* --- Movie Grid --- */
.movies-page {
  padding: 30px 40px;
}

.movies-filters {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 30px;
  padding: 20px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.filter-select {
  padding: 8px 16px;
  padding-left: 30px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='%238b5cf6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 8px center;
  background-size: 20px;
  min-width: 140px;
  cursor: pointer;
}

.filter-select:focus {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
}

.movie-grid .movie-card {
  width: 100%;
}

/* --- Movie Detail Page --- */
.movie-detail {
  position: relative;
}

.detail-backdrop-wrap {
  position: relative;
  width: 100%;
  height: 60vh;
  min-height: 400px;
  overflow: hidden;
}

.detail-backdrop-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-backdrop-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, var(--bg-primary) 0%, transparent 60%),
    linear-gradient(90deg, var(--bg-primary) 0%, transparent 50%);
}

.detail-main {
  position: relative;
  max-width: 1400px;
  margin: -200px auto 0;
  padding: 0 40px 60px;
  display: flex;
  gap: 40px;
  z-index: 2;
}

.detail-poster {
  flex-shrink: 0;
  width: 280px;
}

.detail-poster img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

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

.detail-title-ar {
  font-size: 40px;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 4px;
}

.detail-title-en {
  font-size: 18px;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 16px;
  direction: ltr;
  text-align: right;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  font-size: 15px;
  color: var(--text-secondary);
}

.detail-meta .rating-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  font-weight: 700;
  font-size: 18px;
}

.detail-meta .rating-badge svg {
  width: 20px;
  height: 20px;
  fill: var(--gold);
}

.quality-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.quality-badge {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid var(--gold);
  color: var(--gold);
}

.quality-badge.active {
  background: var(--gold);
  color: var(--text-on-gold);
}

.detail-genres {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.genre-tag {
  padding: 6px 16px;
  background: rgba(139,92,246,0.15);
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: var(--radius-xl);
  font-size: 13px;
  font-weight: 600;
  color: var(--purple-light);
}

.detail-desc {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 28px;
  max-width: 700px;
}

.detail-actions {
  display: flex;
  gap: 14px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

/* Cast Section */
.cast-section,
.similar-section,
.trailer-section {
  padding: 20px 40px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.cast-row {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 10px 0 20px;
  scrollbar-width: none;
}

.cast-row::-webkit-scrollbar { display: none; }

.cast-card {
  flex-shrink: 0;
  width: 130px;
  text-align: center;
  cursor: pointer;
  padding: 12px 8px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.cast-card:hover,
.cast-card:focus {
  background: var(--bg-card);
  transform: translateY(-4px);
}

.cast-photo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  margin: 0 auto 10px;
  overflow: hidden;
  border: 3px solid var(--border-color);
  background: var(--bg-card);
}

.cast-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cast-name {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cast-character {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Trailer */
.trailer-embed {
  position: relative;
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
}

.trailer-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* --- Actor Page --- */
.actor-page {
  padding: 30px 40px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.actor-header {
  display: flex;
  gap: 40px;
  margin-bottom: 40px;
}

.actor-photo-large {
  width: 220px;
  height: 300px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-card);
}

.actor-photo-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.actor-info {
  flex: 1;
}

.actor-name {
  font-size: 36px;
  font-weight: 900;
  margin-bottom: 6px;
}

.actor-name-en {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 16px;
  direction: ltr;
  text-align: right;
}

.actor-bio {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 600px;
}

/* --- Series Detail --- */
.season-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.season-btn {
  padding: 8px 20px;
  border-radius: var(--radius-xl);
  font-size: 14px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.season-btn:hover { border-color: var(--purple); }
.season-btn.active {
  background: var(--purple);
  border-color: var(--purple);
  color: white;
}

.episodes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.episode-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  align-items: center;
}

.episode-item:hover,
.episode-item:focus {
  background: var(--bg-card-hover);
  transform: translateX(-4px);
}

.episode-thumb {
  width: 180px;
  height: 100px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-surface);
  position: relative;
}

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

.episode-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.episode-item:hover .episode-play-icon { opacity: 1; }

.episode-play-icon svg {
  width: 32px;
  height: 32px;
  fill: var(--gold);
}

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

.episode-number {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.episode-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.episode-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.episode-duration {
  font-size: 13px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* --- Search Results Page --- */
.search-page {
  padding: 30px 40px 60px;
}

.search-page-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 30px;
}

.search-page-title span {
  color: var(--gold);
}

/* --- Skeleton Loading --- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

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

.skeleton-card {
  width: 200px;
  flex-shrink: 0;
}

.skeleton-poster {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}

.skeleton-title {
  height: 16px;
  width: 80%;
  border-radius: 4px;
  margin-bottom: 6px;
}

.skeleton-meta {
  height: 12px;
  width: 50%;
  border-radius: 4px;
}

.skeleton-hero {
  width: 100%;
  height: 75vh;
  min-height: 500px;
}

/* --- Video Player --- */
.video-player-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-player);
  background: #000;
}

.player-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

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

.player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 60px 30px 20px;
  background: linear-gradient(0deg, rgba(0,0,0,0.9) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.player-wrapper:hover .player-controls,
.player-wrapper.show-controls .player-controls {
  opacity: 1;
}

.player-back {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  transition: background var(--transition-fast);
  z-index: 5;
}

.player-back svg { width: 24px; height: 24px; }
.player-back:hover { background: rgba(255,255,255,0.25); }

.player-title {
  position: absolute;
  top: 26px;
  right: 80px;
  font-size: 18px;
  font-weight: 700;
  z-index: 5;
}

.player-center-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  margin-bottom: 16px;
}

.player-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  border-radius: 50%;
  padding: 8px;
}

.player-btn:hover,
.player-btn:focus {
  transform: scale(1.15);
}

.player-play-pause {
  width: 60px;
  height: 60px;
  background: var(--gold);
  border-radius: 50%;
}

.player-play-pause svg {
  width: 30px;
  height: 30px;
  fill: var(--text-on-gold);
}

.player-rw, .player-ff {
  position: relative;
  width: 48px;
  height: 48px;
}

.player-rw svg, .player-ff svg {
  width: 36px;
  height: 36px;
}

.player-rw span, .player-ff span {
  position: absolute;
  font-size: 10px;
  font-weight: 700;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Progress Bar */
.player-progress-bar {
  position: relative;
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
  cursor: pointer;
  margin-bottom: 12px;
}

.player-progress-bar:hover {
  height: 10px;
}

.progress-buffered {
  position: absolute;
  height: 100%;
  background: rgba(255,255,255,0.3);
  border-radius: 3px;
  width: 0;
}

.progress-filled {
  position: absolute;
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  width: 0;
}

.progress-thumb {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  background: var(--gold);
  border-radius: 50%;
  transform: translate(50%, -50%);
  box-shadow: 0 0 10px rgba(245,197,24,0.5);
  opacity: 0;
  transition: opacity var(--transition-fast);
  right: 0;
}

.player-progress-bar:hover .progress-thumb { opacity: 1; }

.player-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.player-time {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  direction: ltr;
}

.time-sep { color: var(--text-muted); }

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

.player-right-controls .player-btn svg {
  width: 22px;
  height: 22px;
}

.player-subs, .player-fullscreen {
  width: 40px;
  height: 40px;
}

.player-quality {
  font-size: 13px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 4px;
  padding: 4px 8px;
  width: auto;
  height: auto;
}

.quality-selector {
  position: relative;
}

.quality-menu {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  min-width: 120px;
}

.quality-option {
  display: block;
  width: 100%;
  padding: 8px 16px;
  font-size: 13px;
  text-align: center;
  transition: background var(--transition-fast);
}

.quality-option:hover { background: rgba(139,92,246,0.2); }
.quality-option.active { color: var(--gold); font-weight: 700; }

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

.player-volume {
  width: 40px;
  height: 40px;
}

.player-volume svg { width: 22px; height: 22px; }

.volume-slider {
  width: 80px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  outline: none;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--gold);
  border-radius: 50%;
  cursor: pointer;
}

.player-overlay-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.player-overlay-play.show {
  opacity: 1;
}

.player-overlay-play svg {
  width: 80px;
  height: 80px;
  fill: var(--gold);
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.5));
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  font-size: 14px;
  font-weight: 600;
  z-index: var(--z-toast);
  transition: transform var(--transition-normal);
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* --- Empty State --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  text-align: center;
  padding: 40px;
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state-sub {
  font-size: 14px;
  color: var(--text-muted);
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
  padding: 20px 0;
}

.page-btn {
  min-width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
  padding: 0 14px;
}

.page-btn:hover { border-color: var(--purple); background: var(--bg-card-hover); }
.page-btn.active { background: var(--purple); border-color: var(--purple); color: white; }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* --- Stars --- */
.stars {
  display: inline-flex;
  gap: 2px;
}

.star {
  width: 14px;
  height: 14px;
}

.star.filled { fill: var(--gold); }
.star.empty { fill: var(--text-muted); opacity: 0.3; }
.star.half { fill: url(#halfStarGrad); }

/* --- Responsive --- */
@media (max-width: 1200px) {
  .hero-title { font-size: 36px; }
  .detail-title-ar { font-size: 32px; }
  .detail-main { gap: 30px; }
  .detail-poster { width: 220px; }
}

@media (max-width: 900px) {
  .header-inner { padding: 0 20px; }
  .content-section { padding: 20px; }
  .hero-content { right: 30px; left: 30px; max-width: none; }
  .hero-title { font-size: 28px; }
  .detail-main { flex-direction: column; align-items: center; padding: 0 20px 40px; }
  .detail-poster { width: 200px; }
  .detail-info { text-align: center; }
  .detail-genres, .detail-actions, .quality-badges { justify-content: center; }
  .movies-page, .search-page, .actor-page { padding: 20px; }
  .movie-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
  .actor-header { flex-direction: column; align-items: center; text-align: center; }
  .actor-bio { text-align: center; }
}

@media (max-width: 600px) {
  .nav-link span { display: none; }
  .nav-link { padding: 10px 12px; }
  .logo-text { font-size: 22px; }
  .hero-banner { height: 55vh; min-height: 350px; }
  .hero-content { bottom: 50px; }
  .hero-desc { -webkit-line-clamp: 2; }
  .movie-card { width: 140px; }
  .search-box.open { width: 280px; }
  .section-title { font-size: 18px; }
  .detail-title-ar { font-size: 26px; }
  .cast-section, .similar-section, .trailer-section { padding: 20px; }
  .episode-thumb { width: 120px; height: 68px; }
}

/* --- TV Mode: Extra large focus targets --- */
@media (min-width: 1920px) {
  .movie-card { width: 230px; }
  .nav-link { padding: 12px 24px; font-size: 17px; }
  .btn { padding: 16px 40px; font-size: 18px; min-height: 58px; }
  .hero-title { font-size: 56px; }
  .section-title { font-size: 28px; }
}
