/* ══════════════════════════════════════════════════════════════════════════════
   CYNEFLIX v209 — Design System Update
   New: Premium 3-server selector, enhanced Continue Watching,
   refined component polish, server-3 (VidRock) visual integration.
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── v209 SERVER SELECTOR — 3-Server Premium UI ──────────────────────────────── */

.v209-srv-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px var(--px, 24px) 8px;
  background: rgba(6, 6, 10, .94);
  backdrop-filter: blur(28px) saturate(1.8);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  border: 1px solid rgba(229, 9, 20, .1);
  border-top: none;
  border-radius: 0 0 14px 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.6);
}

.v209-srv-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(255,255,255,.28);
  flex-shrink: 0;
}

.v209-srv-btn-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Individual server button */
.v209-srv-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.5);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .22s cubic-bezier(.22, 1, .36, 1);
  white-space: nowrap;
  position: relative;
  font-family: 'Outfit', sans-serif;
  letter-spacing: .2px;
}

.v209-srv-btn:hover {
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.16);
  color: rgba(255,255,255,.85);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,.5);
}

.v209-srv-btn.active {
  background: linear-gradient(135deg, rgba(229,9,20,.2), rgba(229,9,20,.1));
  border-color: rgba(229,9,20,.45);
  color: #fff;
  box-shadow:
    0 0 0 1px rgba(229,9,20,.15) inset,
    0 4px 18px rgba(229,9,20,.2);
}

.v209-srv-btn.active:hover {
  transform: none;
  box-shadow:
    0 0 0 1px rgba(229,9,20,.2) inset,
    0 4px 18px rgba(229,9,20,.25);
}

/* Server button icon */
.v209-srv-icon {
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

/* Server button labels */
.v209-srv-labels {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
}

.v209-srv-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .2px;
}

.v209-srv-sub {
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,.4);
  line-height: 1;
  letter-spacing: .3px;
}
.v209-srv-btn.active .v209-srv-sub {
  color: rgba(255,255,255,.6);
}

/* Active dot indicator */
.v209-srv-active-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent, #e50914);
  box-shadow: 0 0 6px rgba(229,9,20,.7);
  animation: srv-dot-pulse 2s ease-in-out infinite;
}
@keyframes srv-dot-pulse {
  0%,100% { opacity: 1; box-shadow: 0 0 6px rgba(229,9,20,.7); }
  50%      { opacity: .6; box-shadow: 0 0 12px rgba(229,9,20,.4); }
}

/* Mobile: compact server buttons */
@media (max-width: 600px) {
  .v209-srv-btn-row { gap: 5px; }
  .v209-srv-btn {
    padding: 6px 10px;
    gap: 6px;
  }
  .v209-srv-labels { gap: 0; }
  .v209-srv-name { font-size: 11px; }
  .v209-srv-sub  { display: none; }
  .v209-srv-wrap { padding: 8px var(--px, 14px) 6px; gap: 8px; }
}

/* ── v209 CONTINUE WATCHING SECTION ──────────────────────────────────────────── */

.cw-section {
  padding: 0;
}

.cw-row-cards {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px var(--px, 24px) 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cw-row-cards::-webkit-scrollbar { display: none; }

/* CW card — richer than standard card */
.cw-card {
  flex-shrink: 0;
  width: clamp(150px, 16vw, 200px);
  border-radius: 12px;
  background: rgba(14,14,18,.95);
  border: 1px solid rgba(255,255,255,.07);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: all .28s cubic-bezier(.22,1,.36,1);
  text-decoration: none;
  color: inherit;
}
.cw-card:hover {
  transform: translateY(-6px) scale(1.025);
  border-color: rgba(229,9,20,.25);
  box-shadow:
    0 16px 40px rgba(0,0,0,.8),
    0 0 0 1px rgba(229,9,20,.15),
    0 0 30px rgba(229,9,20,.08);
}

/* Poster */
.cw-poster {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: #0d0d0d;
}
.cw-poster img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s cubic-bezier(.22,1,.36,1);
}
.cw-card:hover .cw-poster img {
  transform: scale(1.06);
}

/* Progress bar on poster */
.cw-progress-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: rgba(255,255,255,.14);
  z-index: 3;
}
.cw-progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--accent, #e50914), #ff3c4a);
  box-shadow: 0 0 8px rgba(229,9,20,.6);
  transition: width .3s ease;
}

/* Play overlay on hover */
.cw-play-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .22s ease;
  z-index: 2;
}
.cw-card:hover .cw-play-overlay { opacity: 1; }
.cw-play-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(229,9,20,.92);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 24px rgba(229,9,20,.55);
  transition: transform .2s ease;
}
.cw-card:hover .cw-play-btn { transform: scale(1.1); }
.cw-play-btn svg {
  width: 18px; height: 18px;
  fill: #fff;
  margin-left: 2px; /* optical center for play icon */
}

/* Type badge on poster */
.cw-type-badge {
  position: absolute; top: 7px; right: 7px;
  font-size: 9px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase;
  padding: 3px 7px; border-radius: 5px;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px);
  color: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.12);
  z-index: 3;
}
.cw-type-badge--tv    { border-color: rgba(229,9,20,.3); color: #a8a8a8; }
.cw-type-badge--movie { border-color: rgba(229,9,20,.3); color: #ff7070; }
.cw-type-badge--anime { border-color: rgba(240,15,27,.3); color: #a0a0a0; }

/* Info below poster */
.cw-info {
  padding: 9px 10px 11px;
}
.cw-title {
  font-size: 12px; font-weight: 700;
  color: #f0f0f0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 4px;
  letter-spacing: .1px;
}
.cw-meta {
  font-size: 10px; font-weight: 500;
  color: rgba(255,255,255,.45);
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden;
}
.cw-meta-ep {
  color: rgba(229,9,20,.8);
  font-weight: 700;
}
.cw-progress-pct {
  font-size: 9px; font-weight: 700;
  color: rgba(255,255,255,.3);
  margin-left: auto;
  flex-shrink: 0;
}

/* Remove button on CW card */
.cw-remove-btn {
  position: absolute; top: 6px; left: 6px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.7);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all .2s ease;
  z-index: 4;
}
.cw-card:hover .cw-remove-btn { opacity: 1; }
.cw-remove-btn:hover {
  background: rgba(229,9,20,.8);
  border-color: rgba(229,9,20,.5);
  color: #fff;
}
.cw-remove-btn svg { width: 12px; height: 12px; }

/* ── v209 ENHANCED SEARCH ────────────────────────────────────────────────────── */

/* Debounce hint / loading state in search */
.search-loading-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(229,9,20,.7);
  animation: search-pulse209 1.2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes search-pulse209 {
  0%,100% { transform: scale(.7); opacity: .5; }
  50%      { transform: scale(1.2); opacity: 1; }
}

/* Search empty state */
.search-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 24px;
  text-align: center;
  animation: fade-up208 .4s ease both;
}
.search-empty-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(229,9,20,.06);
  border: 1px solid rgba(229,9,20,.14);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.search-empty-title {
  font-size: 20px; font-weight: 700;
  color: rgba(255,255,255,.75);
  margin-bottom: 8px;
}
.search-empty-sub {
  font-size: 14px;
  color: rgba(255,255,255,.35);
  line-height: 1.65;
  max-width: 320px;
}

/* ── v209 WATCH PAGE ENHANCEMENTS ────────────────────────────────────────────── */

/* Watch info section */
.watch-info {
  padding: 20px var(--px, 24px) 32px;
  border-top: 1px solid rgba(255,255,255,.04);
}

#watch-title, .watch-title {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: clamp(22px, 4vw, 42px);
  letter-spacing: 2px;
  color: #fff;
  margin: 0 0 10px;
  line-height: 1;
}

.watch-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  color: rgba(255,255,255,.5);
  font-size: 13px;
  margin-bottom: 14px;
}

.watch-rating {
  color: #f11c27;
  font-weight: 700;
}

/* Watch actions */
.watch-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}

/* Overview text */
.watch-overview {
  font-size: 13.5px;
  color: rgba(255,255,255,.5);
  line-height: 1.72;
  max-width: 720px;
}

/* Episode section header */
.ep-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 0 var(--px, 24px);
}

/* ── v209 REFINED GLASSMORPHISM POLISH ───────────────────────────────────────── */

/* Better info modal backdrop */
.info-box {
  backdrop-filter: blur(60px) saturate(2.2) !important;
  -webkit-backdrop-filter: blur(60px) saturate(2.2) !important;
}

/* Better mobile menu transition */
.mobile-menu {
  transition: transform .32s cubic-bezier(.4,0,.2,1),
              backdrop-filter .32s ease !important;
}

/* Better card animation stagger for CW section */
.cw-card:nth-child(1) { animation-delay: .04s; }
.cw-card:nth-child(2) { animation-delay: .08s; }
.cw-card:nth-child(3) { animation-delay: .12s; }
.cw-card:nth-child(4) { animation-delay: .16s; }
.cw-card:nth-child(5) { animation-delay: .20s; }
.cw-card:nth-child(6) { animation-delay: .24s; }
.cw-card { animation: fade-up208 .4s cubic-bezier(.22,1,.36,1) both; }

/* ── v209 MOVIE / TV DETAILS PAGES ──────────────────────────────────────────── */

/* Cinematic hero for movie/TV detail pages */
.detail-hero {
  position: relative;
  min-height: clamp(360px, 48vw, 580px);
  overflow: hidden;
  margin-bottom: 0;
}

.detail-backdrop {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center 20%;
  filter: brightness(.38) saturate(1.15);
  transform: scale(1.02);
  transition: transform 8s ease;
}
.detail-hero:hover .detail-backdrop {
  transform: scale(1.06);
}

.detail-hero-grad {
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(8,8,8,.98) 0%, rgba(8,8,8,.65) 45%, transparent 72%),
    linear-gradient(to top, #080808 0%, transparent 35%),
    linear-gradient(to bottom, rgba(8,8,8,.7) 0%, transparent 20%);
  z-index: 1;
}

.detail-hero-content {
  position: relative; z-index: 2;
  display: flex;
  align-items: flex-end;
  gap: 28px;
  padding: calc(var(--nav-h, 66px) + 40px) var(--px, 24px) 36px;
}

.detail-poster {
  flex-shrink: 0;
  width: clamp(100px, 12vw, 150px);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.08);
  display: none; /* Show on wider screens via responsive */
}
.detail-poster img {
  width: 100%; display: block;
  aspect-ratio: 2/3; object-fit: cover;
}
@media (min-width: 640px) {
  .detail-poster { display: block; }
}

.detail-info { flex: 1; }

.detail-title {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: clamp(30px, 5.5vw, 68px);
  line-height: .97;
  letter-spacing: 2px;
  color: #fff;
  margin: 0 0 12px;
  text-shadow: 0 2px 30px rgba(0,0,0,.9);
}

.detail-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: rgba(255,255,255,.55);
  font-size: 13px;
  margin-bottom: 14px;
}

.detail-rating-badge {
  color: #f11c27;
  font-weight: 700;
  font-size: 14px;
}

.detail-genres {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.detail-genre-pill {
  font-size: 11px; font-weight: 600; letter-spacing: .4px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  color: rgba(255,255,255,.65);
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: all .2s ease;
  text-decoration: none;
  display: inline-block;
}
.detail-genre-pill:hover {
  background: rgba(229,9,20,.1);
  border-color: rgba(229,9,20,.3);
  color: #fff;
}

.detail-overview {
  font-size: 14px;
  color: rgba(255,255,255,.65);
  line-height: 1.75;
  max-width: 560px;
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

/* ── v209 EPISODE LIST ENHANCEMENTS ──────────────────────────────────────────── */

.ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

.ep-card {
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
  transition: all .2s cubic-bezier(.22,1,.36,1);
  cursor: pointer;
  overflow: hidden;
}
.ep-card:hover {
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  transform: translateX(3px);
}
.ep-card.active {
  border-color: rgba(229,9,20,.4);
  background: rgba(229,9,20,.07);
  box-shadow: -3px 0 0 var(--accent, #e50914), 0 0 0 1px rgba(229,9,20,.15);
}

.ep-progress {
  height: 2px;
  background: rgba(255,255,255,.08);
  position: absolute;
  bottom: 0; left: 0; right: 0;
}
.ep-progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--accent, #e50914), #ff3c4a);
}

/* ── v209 SEASON TABS ────────────────────────────────────────────────────────── */

.season-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: none;
  margin-bottom: 16px;
}
.season-tabs::-webkit-scrollbar { display: none; }

.s-tab {
  flex-shrink: 0;
  padding: 7px 18px;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.5);
  font-size: 12px; font-weight: 600;
  transition: all .2s ease;
  white-space: nowrap;
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.s-tab:hover {
  color: #fff;
  border-color: rgba(255,255,255,.22);
  background: rgba(255,255,255,.06);
}
.s-tab.active {
  background: linear-gradient(135deg, var(--accent, #e50914), #c0070f);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 12px rgba(229,9,20,.3);
}

/* ── v209 TOAST IMPROVEMENTS ─────────────────────────────────────────────────── */

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.toast-icon {
  flex-shrink: 0;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.toast-body { flex: 1; }
.toast-title {
  font-size: 13px; font-weight: 700;
  color: #f0f0f0; margin-bottom: 2px;
}
.toast-msg {
  font-size: 12px;
  color: rgba(255,255,255,.5);
  line-height: 1.5;
}

/* ── v209 LOADING SKELETON IMPROVEMENTS ──────────────────────────────────────── */

/* Row skeleton */
.row-skeleton {
  display: flex;
  gap: var(--gap, 10px);
  padding: 4px var(--px, 24px) 16px;
  overflow: hidden;
}
.row-sk-card {
  flex-shrink: 0;
  width: var(--cw, 140px);
  border-radius: 10px;
  background: #111;
  aspect-ratio: 2/3;
  position: relative;
  overflow: hidden;
}
.row-sk-card::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.055) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: sk-shimmer208 1.8s ease-in-out infinite;
}

/* ── v209 FOOTER ENHANCEMENT ──────────────────────────────────────────────────── */

.site-footer {
  padding: 40px var(--px, 24px) 28px;
  border-top: 1px solid rgba(255,255,255,.05);
  background: rgba(4,4,6,.98);
  color: rgba(255,255,255,.35);
  font-size: 12.5px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
}
.footer-links a {
  color: rgba(255,255,255,.4);
  font-size: 12px; font-weight: 500;
  text-decoration: none;
  transition: color .18s;
  letter-spacing: .2px;
}
.footer-links a:hover { color: rgba(255,255,255,.8); }

@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-links { justify-content: center; }
}

/* ── v209 RESPONSIVE POLISH ───────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .v209-srv-btn { padding: 6px 11px; gap: 6px; }
  .v209-srv-name { font-size: 11px; }
  .cw-card { width: clamp(130px, 36vw, 165px); }
  .detail-overview { -webkit-line-clamp: 3; }
  .detail-hero-content { gap: 18px; padding-top: calc(var(--nav-h, 60px) + 24px); }
}

@media (max-width: 480px) {
  .v209-srv-sub { display: none; }
  .cw-card { width: clamp(120px, 38vw, 148px); }
}

/* ── v209 ACCESSIBILITY ───────────────────────────────────────────────────────── */

.v209-srv-btn:focus-visible {
  outline: 2px solid rgba(229,9,20,.7);
  outline-offset: 2px;
}

.cw-card:focus-visible {
  outline: 2px solid rgba(229,9,20,.7);
  outline-offset: 3px;
  border-radius: 12px;
}

/* ── v209 REDUCED MOTION ──────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .detail-backdrop { transition: none !important; }
  .cw-poster img   { transition: none !important; }
  .v209-srv-active-dot { animation: none !important; }
  .cw-card { animation: none !important; }
}

/* ── v209 END ─────────────────────────────────────────────────────────────────── */

/* ── v210: Sidebar-style mobile menu ──────────────────────────── */
.mm-body--sidebar {
  display: flex;
  flex-direction: column;
  padding: 8px 0 16px;
  overflow-y: auto;
  flex: 1;
  gap: 2px;
}

.mm-sidebar-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-muted, rgba(255,255,255,.35));
  padding: 14px 20px 4px;
  margin: 0;
  text-transform: uppercase;
}

.mm-sidebar-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  border-radius: 0;
  transition: background .15s, color .15s;
  position: relative;
}
.mm-sidebar-link:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}
.mm-sidebar-link.active {
  background: rgba(229,9,20,.12);
  color: #fff;
  font-weight: 600;
}
.mm-sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent, #e50914);
  border-radius: 0 2px 2px 0;
}
.mm-sidebar-link--disabled {
  opacity: .4;
  pointer-events: none;
  cursor: default;
}
.mm-sidebar-link--muted {
  color: rgba(255,255,255,.45);
  font-size: 13px;
}
.mm-sidebar-link svg {
  flex-shrink: 0;
  opacity: .7;
}
.mm-sidebar-link.active svg,
.mm-sidebar-link:hover svg {
  opacity: 1;
}

.mm-sidebar-spacer {
  flex: 1;
  min-height: 20px;
}

.mm-sidebar-signin {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 16px 4px;
  padding: 10px 16px;
  background: rgba(229,9,20,.1);
  border: 1px solid rgba(229,9,20,.25);
  border-radius: 8px;
  color: rgba(255,255,255,.8);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
  width: calc(100% - 32px);
}
.mm-sidebar-signin:hover {
  background: rgba(229,9,20,.22);
  color: #fff;
}

/* Make mobile-menu panel wider to match sidebar look */
.mobile-menu {
  width: min(280px, 82vw) !important;
}
