/* ==================== Google Fonts ==================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

:root {
  --primary: #e50914;
  --primary-hover: #f40612;
  --primary-glow: rgba(229, 9, 20, 0.3);
  --accent: #0ea5e9;
  --accent-glow: rgba(14, 165, 233, 0.2);

  --bg-base: #0a0a0f;
  --bg-surface: #111118;
  --bg-elevated: #18181f;
  --bg-hover: #22222d;
  --bg-modal: rgba(10, 10, 15, 0.95);

  --border: rgba(255,255,255,0.07);
  --border-bright: rgba(255,255,255,0.15);

  --text-primary: #f1f1f3;
  --text-secondary: #9898a6;
  --text-muted: #5a5a6a;

  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 24px 64px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 40px var(--primary-glow);

  --transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: all 0.4s cubic-bezier(0.4,0,0.2,1);

  --sidebar-w: 220px;
  --header-h: 60px;
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ==================== Loading Spinner ==================== */
.loading-spinner {
  position: fixed; inset: 0;
  background: var(--bg-base);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 9999; gap: 20px;
}

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

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

.loading-spinner p {
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

/* ==================== Authentication ==================== */
.auth-container {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(229,9,20,0.12) 0%, var(--bg-base) 60%);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}

.auth-container::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.auth-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(28px, 5vw, 48px);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg), 0 0 80px rgba(229,9,20,0.06);
  position: relative;
  backdrop-filter: blur(20px);
}

.auth-header {
  text-align: center;
  margin-bottom: 36px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary), #c00);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  box-shadow: var(--shadow-glow);
}

.auth-header h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.auth-header h1 span { color: var(--primary); }

.auth-header .subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}

.login-form { display: flex; flex-direction: column; gap: 14px; }

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

.form-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-group input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--bg-hover);
}

.form-group input::placeholder { color: var(--text-muted); }

.form-group small { font-size: 11px; color: var(--text-muted); }

.checkbox-group {
  display: flex; align-items: center;
  gap: 10px; cursor: pointer;
  font-size: 14px; color: var(--text-secondary);
}

.checkbox-group input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.error-message {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: #fca5a5;
  font-size: 12.5px;
  white-space: pre-wrap;
  display: none;
  line-height: 1.5;
}

.error-message.show { display: block; }

.auth-footer {
  text-align: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
}

/* ==================== Buttons ==================== */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary);
  color: white;
  width: 100%;
  min-height: 48px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 28px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-bright);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover { background: #dc2626; }

.btn-large { padding: 14px 28px; font-size: 15px; min-height: 50px; }

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

.mt-2 { margin-top: 8px; }

/* ==================== App Layout ==================== */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg-base);
  overflow: hidden;
}

/* ==================== Header ==================== */
.app-header {
  height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  z-index: 100;
  position: relative;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.menu-toggle:hover { background: var(--bg-hover); }

.menu-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: var(--transition);
}

.app-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.app-title span { color: var(--primary); }

.header-center {
  flex: 1;
  max-width: 480px;
  margin: 0 24px;
}

.search-container {
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  overflow: hidden;
  transition: var(--transition);
  height: 38px;
}

.search-container:focus-within {
  border-color: rgba(229,9,20,0.4);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--bg-hover);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0 16px;
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
}

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

.search-btn {
  background: none;
  border: none;
  padding: 0 14px;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
  display: flex;
  align-items: center;
  height: 100%;
}

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

.header-right {
  display: flex;
  gap: 4px;
  align-items: center;
}

.icon-btn {
  background: none;
  border: none;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* ==================== Body Layout ==================== */
.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ==================== Sidebar ==================== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: var(--transition-slow);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 10px;
  flex: 1;
}

.nav-item {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 11px 14px;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
}

.nav-item svg { flex-shrink: 0; opacity: 0.7; transition: var(--transition); }

.nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.nav-item:hover svg { opacity: 1; }

.nav-item.active {
  background: rgba(229,9,20,0.12);
  color: var(--primary);
  font-weight: 600;
}

.nav-item.active svg { opacity: 1; }

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

/* ==================== Main Content ==================== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.view-section {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.view-section.active {
  display: flex;
}

/* ==================== Category Bar ==================== */
.categories-section {
  flex-shrink: 0;
  padding: 14px 20px 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.categories-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 14px;
  scroll-behavior: smooth;
}

.categories-scroll::-webkit-scrollbar { height: 0; }

.category-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 16px;
  border-radius: 100px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  transition: var(--transition);
  flex-shrink: 0;
  height: 32px;
  display: flex;
  align-items: center;
}

.category-btn:hover {
  border-color: var(--border-bright);
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.category-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 12px var(--primary-glow);
}

/* ==================== Content Grid ==================== */
.grid-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

/* Loading state for grid */
.grid-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  flex-direction: column;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 13px;
}

.grid-loading .spinner { width: 32px; height: 32px; border-width: 2px; }

/* ==================== Content Card ==================== */
.content-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.content-card:hover {
  border-color: rgba(229,9,20,0.4);
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(229,9,20,0.2);
}

.card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-elevated);
  position: relative;
  overflow: hidden;
}

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

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

.card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-hover));
  font-size: 28px;
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.content-card:hover .card-overlay { opacity: 1; }

.card-play-btn {
  width: 44px; height: 44px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px var(--primary-glow);
  transform: scale(0.8);
  transition: var(--transition);
}

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

.card-live-badge {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--primary);
  color: white;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-live-badge::before {
  content: '';
  width: 5px; height: 5px;
  background: white;
  border-radius: 50%;
  animation: pulse 1.5s ease infinite;
}

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

.card-fav-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  width: 26px; height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.card-info {
  padding: 10px 12px 12px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

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

.card-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-live { background: rgba(229,9,20,0.15); color: var(--primary); }
.badge-movie { background: rgba(14,165,233,0.15); color: var(--accent); }
.badge-series { background: rgba(34,197,94,0.15); color: var(--success); }

/* ==================== Empty State ==================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: var(--text-muted);
  text-align: center;
  gap: 12px;
}

.empty-state-icon { font-size: 48px; opacity: 0.4; }

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-state p { font-size: 13px; max-width: 280px; line-height: 1.6; }

/* ==================== History View ==================== */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
}

.history-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  gap: 14px;
  cursor: pointer;
  transition: var(--transition);
  align-items: center;
}

.history-item:hover {
  border-color: rgba(229,9,20,0.3);
  background: var(--bg-elevated);
  transform: translateX(4px);
}

.history-item-thumbnail {
  width: 96px; height: 56px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.history-item-thumbnail img {
  width: 100%; height: 100%; object-fit: cover;
}

.history-item-content { flex: 1; min-width: 0; }

.history-item-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==================== Toasts ==================== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 20px;
  border-radius: 100px;
  font-size: 13.5px;
  font-weight: 500;
  z-index: 8000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast.success { background: var(--success); color: white; box-shadow: 0 8px 32px rgba(34,197,94,0.3); }
.toast.error { background: var(--danger); color: white; box-shadow: 0 8px 32px rgba(239,68,68,0.3); }
.toast.info { background: var(--info); color: white; box-shadow: 0 8px 32px rgba(59,130,246,0.3); }
.toast.warning { background: var(--warning); color: black; }

/* ==================== Modals ==================== */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes slideUp {
  from { transform: translateY(40px) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.close-btn {
  background: var(--bg-hover);
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
  flex-shrink: 0;
}

.close-btn:hover {
  background: rgba(229,9,20,0.15);
  color: var(--primary);
}

/* ==================== Settings Modal ==================== */
.settings-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  gap: 4px;
}

.settings-tab {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 14px 16px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition);
}

.settings-tab:hover { color: var(--text-primary); }

.settings-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.settings-content { padding: 24px; }

.settings-panel { display: none; }

.settings-panel.active { display: block; }

.setting-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.setting-group input[type="range"],
.setting-group input[type="number"],
.setting-group select {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  transition: var(--transition);
}

.setting-group select:focus,
.setting-group input[type="number"]:focus {
  outline: none;
  border-color: var(--primary);
}

.setting-group select option {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.setting-group .checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 400;
  color: var(--text-secondary);
}

.setting-group .checkbox input {
  accent-color: var(--primary);
}

.about-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.about-info p strong { color: var(--text-primary); }

.about-info hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 8px 0;
}

/* ==================== Profile Modal ==================== */
.profile-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.profile-avatar {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--primary), #900);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  box-shadow: 0 0 40px var(--primary-glow);
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

.profile-info strong {
  font-size: 18px;
  color: var(--text-primary);
}

.profile-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ==================== EPG Section ==================== */
.epg-container {
  flex: 1;
  overflow: auto;
  padding: 20px;
}

.epg-timeline { margin-bottom: 16px; }
.epg-programs { display: flex; flex-direction: column; gap: 8px; }

/* ==================== Debug Panel ==================== */
#login-debug {
  display: none !important;
}

/* ==================== Animations ==================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.content-card {
  animation: fadeInUp 0.3s ease both;
}

.content-card:nth-child(1) { animation-delay: 0.02s; }
.content-card:nth-child(2) { animation-delay: 0.04s; }
.content-card:nth-child(3) { animation-delay: 0.06s; }
.content-card:nth-child(4) { animation-delay: 0.08s; }
.content-card:nth-child(5) { animation-delay: 0.10s; }
.content-card:nth-child(n+6) { animation-delay: 0.12s; }

/* â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�
   SERIES DETAIL MODAL
â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•� */
.series-modal-overlay {
  align-items: flex-start;
  padding: 0;
}

.series-modal-content {
  background: var(--bg-surface);
  width: 100%;
  max-width: 1000px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: var(--radius-xl);
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
  margin: auto;
}

.series-close-x {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 10;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  border: none; color: white;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 22px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  transition: var(--transition);
}
.series-close-x:hover { background: var(--primary); }

/* Hero section */
.series-hero {
  position: relative;
  min-height: 260px;
  background: var(--bg-elevated);
  background-size: cover;
  background-position: center top;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow: hidden;
}

.series-hero-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(11,11,18,0.98) 0%, rgba(11,11,18,0.7) 50%, rgba(11,11,18,0.3) 100%),
              linear-gradient(to top, rgba(11,11,18,1) 0%, transparent 50%);
}

.series-hero-inner {
  position: relative;
  display: flex;
  gap: 24px;
  padding: 32px 28px 24px;
  align-items: flex-start;
}

.series-cover {
  width: 120px;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--border);
}

.series-hero-text { flex: 1; min-width: 0; }
.series-hero-text h2 { font-size: clamp(18px,3vw,28px); font-weight: 800; margin-bottom: 10px; line-height: 1.2; }

.series-badges-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.series-badge {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 10px;
  font-size: 12px; color: var(--text-secondary);
}

.series-plot {
  font-size: 13.5px; line-height: 1.6;
  color: var(--text-secondary);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 8px;
}
.series-cast { font-size: 12px; color: var(--text-muted); }

/* Body */
.series-body { padding: 0 0 20px; }

/* Season tabs bar */
.season-tabs-bar {
  display: flex;
  gap: 4px;
  padding: 16px 20px 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  position: sticky; top: 0; z-index: 5;
}
.season-tabs-bar::-webkit-scrollbar { height: 0; }

.season-tab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 7px 18px;
  border-radius: 100px;
  cursor: pointer;
  font-size: 13px; font-weight: 500; font-family: inherit;
  white-space: nowrap; flex-shrink: 0;
  transition: var(--transition);
}
.season-tab:hover { border-color: var(--border-bright); color: var(--text-primary); }
.season-tab.active {
  background: var(--primary); border-color: var(--primary);
  color: white; font-weight: 600;
  box-shadow: 0 2px 12px var(--primary-glow);
}

/* Episode grid */
.episode-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 20px;
}

.episode-card {
  display: flex;
  gap: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  align-items: stretch;
}
.episode-card:hover { border-color: rgba(229,9,20,0.4); background: var(--bg-hover); transform: translateX(4px); }

.episode-thumb {
  width: 140px; min-height: 78px;
  background: var(--bg-base);
  position: relative; flex-shrink: 0;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.episode-thumb img { width: 100%; height: 100%; object-fit: cover; }

.episode-num-badge {
  position: absolute; bottom: 6px; left: 6px;
  background: rgba(0,0,0,0.75);
  color: white; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px;
  letter-spacing: 0.5px;
}

.episode-play-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: var(--transition);
}
.episode-card:hover .episode-play-overlay { opacity: 1; }

.episode-info { flex: 1; padding: 12px 16px 12px 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.episode-title { font-size: 14px; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.episode-meta { font-size: 11.5px; color: var(--text-muted); }
.episode-plot {
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}



/* â•�â•�â•� VOD DETAIL MODAL â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•� */
.vod-modal-overlay {
  background: rgba(10, 10, 14, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.vod-modal-content {
  width: 90%;
  max-width: 1000px;
  background: rgba(20, 20, 25, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: modalScaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.vod-close-x {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 20;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  backdrop-filter: blur(10px);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.vod-close-x:hover { background: rgba(255, 255, 255, 0.2); transform: scale(1.1); }

.vod-hero {
  position: relative;
  width: 100%;
  min-height: 500px;
  background-size: cover;
  background-position: center 20%;
  display: flex;
  align-items: flex-end;
}
.vod-hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20, 20, 25, 1) 0%, rgba(20, 20, 25, 0.8) 40%, rgba(20, 20, 25, 0.2) 100%);
  background-blend-mode: multiply;
}
.vod-hero-content {
  position: relative;
  z-index: 10;
  display: flex;
  gap: 40px;
  padding: 40px;
  width: 100%;
  align-items: flex-end;
}
.vod-cover-wrapper {
  flex-shrink: 0;
  width: 220px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.1);
  background: #111;
}
.vod-cover-wrapper img {
  width: 100%;
  height: auto;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
}
.vod-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#vod-modal-title {
  font-size: 2.8rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.1;
  background: linear-gradient(90deg, #fff, #aaa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.vod-meta-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.vod-badge {
  background: rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.vod-badge.rating { background: rgba(255, 171, 0, 0.2); color: #ffab00; border-color: rgba(255, 171, 0, 0.3); }
.vod-genre { font-size: 0.95rem; color: #aaa; }
.vod-plot {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #ddd;
  margin: 0;
  max-height: 120px;
  overflow-y: auto;
  padding-right: 10px;
}
.vod-cast-info p { margin: 4px 0; font-size: 0.9rem; color: #999; }
.vod-cast-info span { color: #ccc; }
.vod-actions { display: flex; gap: 16px; margin-top: 10px; }
.vod-actions .btn {
  padding: 14px 28px;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}
.vod-actions .btn-primary {
  background: linear-gradient(135deg, #00B4DB, #0083B0);
  color: white;
  box-shadow: 0 8px 20px rgba(0, 180, 219, 0.3);
  border: none;
}
.vod-actions .btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 25px rgba(0, 180, 219, 0.4);
}
.vod-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}
.vod-actions .btn-secondary.active {
  background: rgba(255, 40, 80, 0.2);
  border-color: rgba(255, 40, 80, 0.5);
  color: #ff2850;
}
.vod-actions .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

@media (max-width: 768px) {
  .vod-hero-content { flex-direction: column; align-items: center; text-align: center; padding: 30px 20px; gap: 24px; }
  .vod-cover-wrapper { width: 160px; }
  #vod-modal-title { font-size: 2rem; }
  .vod-meta-row { justify-content: center; }
  .vod-actions { justify-content: center; width: 100%; flex-wrap: wrap; }
  .vod-actions .btn { flex: 1; min-width: 140px; justify-content: center; }
}


.cast-gallery {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding: 10px 0;
  max-width: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.cast-gallery::-webkit-scrollbar { height: 6px; }
.cast-gallery::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }
.cast-member {
  flex-shrink: 0;
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s;
  text-align: center;
}
.cast-member:hover { transform: translateY(-5px); }
.cast-photo {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255,255,255,0.1);
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  border: 2px solid transparent;
  transition: border 0.3s;
}
.cast-member:hover .cast-photo { border-color: #00B4DB; }
.cast-name { font-size: 0.75rem; color: #eee; font-weight: 500; line-height: 1.2; }
.cast-role { font-size: 0.65rem; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }

/* ¦¦ PREMIUM INTEGRATED PLAYER ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ */
.vod-player-section {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  position: relative;
  overflow: hidden;
  border-radius: 0 0 16px 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 -20px 40px rgba(0,0,0,0.5);
}

.premium-player-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.premium-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-ui-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 20%, transparent 80%, rgba(0,0,0,0.8) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
  cursor: pointer;
}

.vod-player-section:hover .player-ui-overlay,
.player-ui-overlay.active {
  opacity: 1;
}

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

.player-ui-title {
  color: white;
  font-size: 1.1rem;
  font-weight: 500;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.player-ui-close {
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  transition: background 0.2s;
}

.player-ui-close:hover { background: rgba(255,255,255,0.2); }

.player-ui-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

.big-play-btn {
  background: rgba(229, 9, 20, 0.9);
  border: none;
  color: white;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(229, 9, 20, 0.4);
  transition: transform 0.2s, background 0.2s;
}

.big-play-btn:hover { transform: scale(1.1); background: #f6121d; }
.big-play-btn svg { margin-left: 5px; }

.seek-btn {
  background: none;
  border: none;
  color: white;
  opacity: 0.8;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}

.seek-btn:hover { opacity: 1; transform: scale(1.1); }

.player-ui-bottom {
  width: 100%;
}

.player-ui-progress-wrapper {
  width: 100%;
  height: 20px;
  display: flex;
  align-items: center;
  cursor: pointer;
  margin-bottom: 10px;
}

.player-ui-progress-bg {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  position: relative;
  transition: height 0.2s;
}

.player-ui-progress-wrapper:hover .player-ui-progress-bg { height: 6px; }

.player-ui-buffer {
  position: absolute;
  top: 0; left: 0; height: 100%;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
}

.player-ui-progress-fill {
  position: absolute;
  top: 0; left: 0; height: 100%;
  background: #e50914;
  border-radius: 2px;
  z-index: 2;
}

.player-ui-handle {
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 14px;
  background: #e50914;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.2s;
  z-index: 3;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.player-ui-progress-wrapper:hover .player-ui-handle { transform: translate(-50%, -50%) scale(1); }

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

.controls-group {
  display: flex;
  align-items: center;
  gap: 15px;
}

.ui-icon-btn, .ui-text-btn {
  background: none;
  border: none;
  color: white;
  opacity: 0.8;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: opacity 0.2s;
}

.ui-icon-btn:hover, .ui-text-btn:hover { opacity: 1; }

.ui-text-btn {
  font-weight: 600;
  font-size: 0.9rem;
  background: rgba(255,255,255,0.1);
  padding: 4px 10px;
  border-radius: 4px;
}

.ui-time {
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 100px;
}

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

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

.ui-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
}

.ui-menu-wrapper { position: relative; }

.ui-popup-menu {
  position: absolute;
  bottom: 40px;
  right: 0;
  background: rgba(20,20,20,0.95);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 8px;
  display: none;
  flex-direction: column;
  min-width: 120px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 20;
}

.ui-menu-item {
  padding: 8px 12px;
  color: white;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 4px;
  white-space: nowrap;
  text-align: left;
}

.ui-menu-item:hover { background: rgba(255,255,255,0.1); }
.ui-menu-item.active { color: #e50914; font-weight: 600; }

.player-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  z-index: 5;
  color: white;
}

.fancy-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255,255,255,0.1);
  border-top-color: #e50914;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

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


/* ¦¦ WORLD-CLASS VOD & THEATER MODE ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ */
:root {
  --cinema-red: #e50914;
  --glass-bg: rgba(20, 20, 20, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
}

.vod-modal-overlay {
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  overflow-y: auto;
  perspective: 1000px;
}

.vod-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(60px) brightness(40%);
  opacity: 0.6;
  z-index: -1;
  transition: opacity 0.8s ease;
}

.vod-modal-content {
  width: 95%;
  max-width: 1100px;
  background: #111;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 100px rgba(0,0,0,0.8);
  border: 1px solid var(--glass-border);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Response Design: Mobile Stacking */
@media (max-width: 768px) {
  .vod-hero-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px 20px !important;
  }
  .vod-cover-wrapper {
    width: 140px !important;
    margin-right: 0 !important;
    margin-bottom: 20px;
  }
  .vod-meta-row { justify-content: center; }
  .vod-actions { justify-content: center; flex-wrap: wrap; }
  .vod-modal-content { width: 98%; margin: 10px; }
  .vod-details h2 { font-size: 1.5rem !important; }
}

.vod-hero {
  position: relative;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* THEATER MODE ACTIVE */
.vod-modal-content.theater-active .vod-hero {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
  height: 0;
  overflow: hidden;
}

.vod-modal-content.theater-active .vod-player-section {
  display: block !important;
  height: 100vh;
  max-height: 80vh;
}

.vod-player-section {
  transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.glass-fx {
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
}

.glass-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.05);
  color: white;
  transition: all 0.3s;
}
.glass-btn:hover { background: rgba(255,255,255,0.15); }

.highlight {
  background: linear-gradient(90deg, #fff, rgba(255,255,255,0.5));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cinema-spinner {
  width: 60px; height: 60px;
  border: 4px solid rgba(255,255,255,0.05);
  border-top-color: var(--cinema-red);
  border-radius: 50%;
  animation: spin 1s infinite cubic-bezier(0.5, 0, 0.5, 1);
}

.player-ui-overlay.theater-controls {
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 150px);
}

.btn-ripple {
   position: relative;
   overflow: hidden;
   transform: translate3d(0,0,0);
}

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


/* ¦¦ PREMIUM PLAYER CONTROLS ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ */
.premium-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.premium-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  background: var(--cinema-red);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.5);
}

.premium-select {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--glass-border);
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  outline: none;
  font-size: 0.85rem;
}

.player-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  gap: 20px;
}

.player-controls-group {
  display: flex;
  align-items: center;
  gap: 15px;
}

.player-progress-area {
  padding: 0 20px;
  margin-bottom: 5px;
}

.player-progress-track {
  position: relative;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  cursor: pointer;
}

.player-progress-fill {
  position: absolute;
  height: 100%;
  background: var(--cinema-red);
  border-radius: 2px;
  z-index: 2;
}

.player-progress-extra {
  position: absolute;
  height: 100%;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  z-index: 1;
}

.player-progress-thumb {
  position: absolute;
  top: 50%;
  width: 12px; height: 12px;
  background: white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.player-ui-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

.ctrl-btn-main {
  width: 50px; height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cinema-red) !important;
}

.player-time-display {
  font-size: 0.9rem;
  font-family: monospace;
  color: #ddd;
}
.player-time-display .sep { margin: 0 5px; opacity: 0.5; }


/* ¦¦ FULLSCREEN GLOBAL PLAYER ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ */
.player-modal {
  position: fixed;
  inset: 0;
  background: black;
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

.player-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.premium-player-container {
  flex: 1;
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.premium-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-ui-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 30px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.player-ui-header * { pointer-events: auto; }

.player-ui-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0;
}

.player-ui-overlay.theater-controls {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding-bottom: 30px;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  z-index: 5;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.player-ui-overlay.theater-controls.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.player-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  z-index: 20;
}

.player-info-toast {
  position: absolute;
  left: 30px;
  bottom: 120px;
  max-width: 400px;
  padding: 20px;
  background: rgba(20,20,20,0.8);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  z-index: 6;
  animation: slideUp 0.4s ease-out;
}

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


/* ¦¦ UNIFIED PREMIUM CINEMA PLAYER ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ */
.player-modal {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: none;
  flex-direction: column;
  color: white;
  overflow: hidden;
}

.player-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(40px) brightness(0.3);
  opacity: 0;
  transition: opacity 1s ease;
  z-index: 1;
}

.player-container {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 2;
  display: flex;
  flex-direction: column;
}

.premium-player-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.premium-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  box-shadow: 0 0 100px rgba(0,0,0,0.5);
}

.player-ui-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 40px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  pointer-events: none;
}
.player-ui-header * { pointer-events: auto; }

.player-ui-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.player-ui-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: opacity 0.4s ease, transform 0.4s ease;
  background: radial-gradient(circle, transparent 40%, rgba(0,0,0,0.6) 100%);
}

.player-ui-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
}

.player-ui-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
}

.big-play-btn {
  width: 100px; height: 100px;
  background: var(--cinema-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(229, 9, 20, 0.4);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.big-play-btn:hover { transform: scale(1.15); }

.seek-btn {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  width: 60px; height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.2s;
}
.seek-btn:hover { background: rgba(255,255,255,0.2); }

.player-ui-overlay theater-controls {
   background: linear-gradient(to top, rgba(0,0,0,0.95), transparent 40%);
   padding-bottom: 40px;
}

.player-progress-area {
  padding: 0 40px;
  margin-bottom: 10px;
}

.player-progress-track {
  position: relative;
  height: 6px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
  cursor: pointer;
}

.player-progress-fill {
  position: absolute;
  height: 100%;
  background: var(--cinema-red);
  border-radius: 3px;
  z-index: 2;
  box-shadow: 0 0 10px var(--cinema-red);
}

.player-progress-thumb {
  position: absolute;
  top: 50%;
  width: 18px; height: 18px;
  background: white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  transition: transform 0.1s;
}

.player-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
}

.player-controls-group {
  display: flex;
  align-items: center;
  gap: 25px;
}

.ctrl-btn-main {
  width: 60px; height: 60px;
  background: var(--cinema-red) !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(229, 9, 20, 0.3);
}

.player-time-display {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: #ccc;
}
.player-time-display .sep { margin: 0 8px; opacity: 0.5; }

.ui-menu-wrapper {
  position: relative;
}

.ui-popup-menu {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  min-width: 140px;
  z-index: 50;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.ui-menu-item {
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
  text-align: center;
}
.ui-menu-item:hover { background: rgba(255,255,255,0.1); }
.ui-menu-item.active { color: var(--cinema-red); font-weight: 700; }

.player-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(10px);
  z-index: 20;
}


/* Language picker on the sign-in screen */
.auth-lang {
  display: block;
  margin: 0 auto 12px;
  background: var(--bg-surface);
  color: var(--text-secondary, var(--text-muted));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
}
