/* =========================================
   NYEKFLIX — home.css (Optimized v3)
========================================= */

/* ── DESIGN TOKENS ── */
:root {
  --bg-primary:   #141414;
  --bg-card:      #1f1f1f;
  --bg-modal:     #181818;
  --bg-elevated:  #242424;
  --red:          #E50914;
  --red-hover:    #b81d24;
  --text-primary:   #ffffff;
  --text-secondary: #b3b3b3;
  --text-muted:     #737373;
  --border:         rgba(255,255,255,0.08);
  --shadow-card:    0 8px 32px rgba(0,0,0,0.6);
  --shadow-modal:   0 0 60px rgba(0,0,0,0.9);
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-pill: 50px;
  --transition-fast: 0.15s ease;
  --transition-med:  0.25s ease;
  --transition-slow: 0.4s ease;
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── RESET ── */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}
img    { display: block; max-width: 100%; }
button { font-family: inherit; -webkit-appearance: none; touch-action: manipulation; }

/* ═══════════════════════════════════════
   LOVE GATE MODAL
═══════════════════════════════════════ */
.kilig-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex; justify-content: center; align-items: center;
  z-index: 9999;
  animation: fadeIn 0.4s ease;
}
.kilig-content {
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 30px;
  text-align: center;
  max-width: 320px; width: 90%;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.kilig-heart { font-size: 3rem; margin-bottom: 16px; animation: heartbeat 1.5s ease-in-out infinite; }
.kilig-content h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 10px; }
.kilig-content p  { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.5; }
.kilig-buttons { display: flex; flex-direction: column; gap: 10px; }

.btn-iloveyou {
  background: var(--red); color: white; border: none;
  padding: 14px 24px; border-radius: var(--radius-pill);
  font-size: 1rem; font-weight: 700; cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-iloveyou:hover, .btn-iloveyou:active { background: var(--red-hover); transform: scale(0.97); }

.btn-ayoko {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 12px 24px; border-radius: var(--radius-pill);
  font-size: 0.9rem; cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-ayoko:hover { color: var(--text-secondary); border-color: rgba(255,255,255,0.2); }

/* ═══════════════════════════════════════
   NAVBAR
═══════════════════════════════════════ */
.navbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; padding-top: calc(16px + var(--safe-top));
  background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, transparent 100%);
  position: fixed; top: 0; left: 0; width: 100%;
  z-index: 100;
  transition: background var(--transition-med), padding var(--transition-med);
  will-change: background;
}
.navbar.scrolled {
  background: rgba(20,20,20,0.98);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.netflix-logo {
  font-size: 22px; font-weight: 900; color: var(--red);
  letter-spacing: -0.5px; text-shadow: 0 2px 8px rgba(229,9,20,0.4);
  user-select: none;
}
.nav-icons { display: flex; align-items: center; gap: 6px; }
.nav-icons button {
  background: none; border: none; color: var(--text-primary); cursor: pointer;
  font-size: 18px; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition-fast);
}
.nav-icons button:hover, .nav-icons button:active { background: rgba(255,255,255,0.1); }

/* ═══════════════════════════════════════
   BANNER (HERO)
═══════════════════════════════════════ */
.banner {
  position: relative;
  height: 72vh; min-height: 400px;
  background-size: cover; background-position: center top;
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.banner-gradient {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, #141414 0%, rgba(20,20,20,0.6) 40%, rgba(20,20,20,0.1) 70%, transparent 100%),
    linear-gradient(to right, rgba(0,0,0,0.7) 0%, transparent 60%);
  z-index: 1;
}
/* Banner preview iframe must not intercept clicks */
.banner iframe { pointer-events: none; }

.banner-content { position: relative; z-index: 2; padding: 0 24px 32px; width: 100%; max-width: 600px; }
.banner-badge   { display: inline-flex; align-items: center; gap: 6px; background: var(--red); padding: 4px 10px; border-radius: var(--radius-sm); margin-bottom: 12px; }
.badge-text     { font-size: 0.65rem; font-weight: 800; letter-spacing: 1.5px; color: white; text-transform: uppercase; }
.banner-title   { font-size: clamp(1.6rem, 5vw, 3rem); font-weight: 800; line-height: 1.1; text-shadow: 0 2px 16px rgba(0,0,0,0.8); margin-bottom: 10px; }
.banner-overview {
  font-size: 0.9rem; line-height: 1.5; color: rgba(255,255,255,0.85); margin-bottom: 18px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.banner-buttons { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  padding: 10px 22px; border: none; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 0.95rem; font-weight: 700;
  transition: all var(--transition-fast);
  display: inline-flex; align-items: center; gap: 7px;
  white-space: nowrap; touch-action: manipulation;
}
.btn-play { background: white; color: black; }
.btn-play:hover,  .btn-play:active  { background: rgba(255,255,255,0.8); transform: scale(0.97); }
.btn-info { background: rgba(109,109,110,0.5); color: white; border: 1px solid rgba(255,255,255,0.15); backdrop-filter: blur(8px); }
.btn-info:hover,  .btn-info:active  { background: rgba(109,109,110,0.7); transform: scale(0.97); }

/* ═══════════════════════════════════════
   MAIN CONTENT & SECTIONS
═══════════════════════════════════════ */
.main-content { padding-bottom: 40px; }

.section       { margin-top: 24px; padding: 0 24px; }
.section-title { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.title-tag     { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: lowercase; letter-spacing: 0.3px; }

/* ── Genre section ── */
.genre-section { padding-top: 4px; padding-bottom: 4px; }
.genre-scroll  {
  display: flex; gap: 14px; overflow-x: auto;
  padding: 14px 24px; -ms-overflow-style: none; scrollbar-width: none; scroll-behavior: smooth;
}
.genre-scroll::-webkit-scrollbar { display: none; }
.genre-btn {
  background: transparent; color: rgba(255,255,255,0.75); border: none;
  padding: 12px 22px; border-radius: var(--radius-pill);
  font-size: 1rem; font-weight: 700; height: 48px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: all var(--transition-fast);
}
.genre-btn:hover, .genre-btn:active { background: rgba(255,255,255,0.1); color: white; transform: scale(1.08); }

/* ── Carousels ── */
.carousel {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 4px 0 12px; -ms-overflow-style: none; scrollbar-width: none;
  scroll-behavior: smooth; scroll-snap-type: x mandatory;
}
.carousel::-webkit-scrollbar { display: none; }

/* ── Content cards ── */
.content-card {
  flex: 0 0 120px; height: 180px; cursor: pointer;
  border-radius: var(--radius-md);
  background-size: cover; background-position: center; background-color: var(--bg-card);
  transition: transform var(--transition-med), box-shadow var(--transition-med);
  position: relative; overflow: hidden;
  scroll-snap-align: start; will-change: transform;
}
.content-card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%);
  opacity: 0; transition: opacity var(--transition-fast); border-radius: inherit;
}
.content-card:hover::after, .content-card:active::after { opacity: 1; }

@media (hover: hover) {
  .content-card:hover { transform: scale(1.08) translateY(-4px); box-shadow: var(--shadow-card); z-index: 2; }
}

/* Rank overlay */
.rank-number {
  position: absolute; left: -30px; bottom: 0;
  font-size: 4rem; font-weight: 900; line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255,255,255,0.3);
  text-stroke: 2px rgba(255,255,255,0.3);
  user-select: none; pointer-events: none; letter-spacing: -3px;
}

/* Progress bar */
.card-progress {
  position: absolute; bottom: 0; left: 0; height: 3px;
  background: var(--red); border-radius: 0 0 0 var(--radius-md); pointer-events: none;
}

/* ═══════════════════════════════════════
   SCROLL WRAPPER + BUTTONS
═══════════════════════════════════════ */
.row-container {
  position: relative; width: 100%;
  display: flex; align-items: center;
}

.scroll-btn {
  position: absolute; top: 0; bottom: 12px;
  z-index: 10;
  background: rgba(0,0,0,0.6); color: white; border: none;
  font-size: 2rem; cursor: pointer; width: 45px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition-fast), transform var(--transition-fast), opacity var(--transition-med);
  opacity: 0;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
@media (hover: hover) { .row-container:hover .scroll-btn { opacity: 1; } }
@media (hover: none)  { .scroll-btn { display: none; } }

.scroll-btn:hover  { background: rgba(0,0,0,0.9); color: var(--red); }
.scroll-btn:active { transform: scale(0.9); }

.left-btn  { left: 0;  border-top-right-radius: var(--radius-md); border-bottom-right-radius: var(--radius-md); background: linear-gradient(to right, rgba(0,0,0,0.8), rgba(0,0,0,0.2)); }
.right-btn { right: 0; border-top-left-radius:  var(--radius-md); border-bottom-left-radius:  var(--radius-md); background: linear-gradient(to left,  rgba(0,0,0,0.8), rgba(0,0,0,0.2)); }

/* Genre-specific scroll button overrides */
.genre-row-wrapper .scroll-btn {
  height: 40px; width: 40px;
  top: 50%; bottom: auto; transform: translateY(-50%);
  border-radius: 50%; font-size: 1.2rem; margin: 0 10px;
  background: rgba(20,20,20,0.9); border: 1px solid var(--border);
}
.genre-row-wrapper .scroll-btn:hover  { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--red); }
.genre-row-wrapper .scroll-btn:active { transform: translateY(-50%) scale(0.9); }

/* Fade edge gradients on genre row */
.genre-row-wrapper::before,
.genre-row-wrapper::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 40px; z-index: 5; pointer-events: none;
}
.genre-row-wrapper::before { left:  0; background: linear-gradient(to right, var(--bg-primary) 20%, transparent); }
.genre-row-wrapper::after  { right: 0; background: linear-gradient(to left,  var(--bg-primary) 20%, transparent); }

/* ── Category back button ── */
.back-category-btn {
  background: transparent; color: white; border: none;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
  transition: color var(--transition-fast), transform var(--transition-fast);
}
.back-category-btn:hover { color: var(--red); transform: translateX(-5px); }

/* ── Category Grid (infinite scroll) ── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  padding: 4px 0 20px;
}

.category-card {
  width: 100%;
  aspect-ratio: 2 / 3;
  cursor: pointer;
  border-radius: var(--radius-md);
  background-size: cover;
  background-position: center;
  background-color: var(--bg-card);
  transition: transform var(--transition-med), box-shadow var(--transition-med);
  position: relative;
  overflow: hidden;
}
.category-card::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-fast);
  border-radius: inherit;
}
.category-card:hover::after, .category-card:active::after { opacity: 1; }
@media (hover: hover) {
  .category-card:hover { transform: scale(1.05); box-shadow: var(--shadow-card); z-index: 2; }
}

/* Larger cards on bigger screens */
@media (min-width: 600px)  { .category-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; } }
@media (min-width: 1024px) { .category-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; } }
@media (min-width: 1400px) { .category-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }

.category-sentinel {
  padding: 24px 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  min-height: 60px;
}

/* ═══════════════════════════════════════
   DETAIL MODAL
═══════════════════════════════════════ */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: none; justify-content: center; align-items: flex-start;
  z-index: 1000; overflow-y: auto; padding: 0;
  -webkit-overflow-scrolling: touch;
}
.modal-content {
  background: var(--bg-modal); width: 100%; max-width: 600px;
  margin: 0 auto; position: relative; border-radius: 0;
  box-shadow: var(--shadow-modal); min-height: 100vh;
  animation: slideUpModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 600px) {
  .modal { padding: 30px 20px; align-items: center; }
  .modal-content {
    border-radius: var(--radius-lg); min-height: auto; max-height: 90vh;
    overflow-y: auto; -ms-overflow-style: none; scrollbar-width: none;
  }
  .modal-content::-webkit-scrollbar { display: none; }
}

/* When video-wrapper enters native fullscreen */
#video-wrapper:fullscreen,
#video-wrapper:-webkit-full-screen,
#video-wrapper:-moz-full-screen,
#video-wrapper:-ms-fullscreen {
  padding-bottom: 0 !important; 
  height: 100% !important; /* Changed from 100vh to fix mobile cutouts */
  width: 100% !important;  /* Changed from 100vw */
  background: #000 !important;
  margin: 0 !important;
  overflow: hidden !important; /* Prevents the browser from allowing scrolls */
}

#video-wrapper:fullscreen iframe,
#video-wrapper:-webkit-full-screen iframe,
#video-wrapper:-moz-full-screen iframe {
  position: absolute !important; 
  top: 0 !important; 
  left: 0 !important; 
  width: 100% !important; 
  height: 100% !important;
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

#video-wrapper:fullscreen #fullscreen-btn,
#video-wrapper:-webkit-full-screen #fullscreen-btn,
#video-wrapper:-moz-full-screen #fullscreen-btn { 
  /* Respects mobile notches and safe areas so the button doesn't hide behind camera cutouts */
  bottom: max(16px, env(safe-area-inset-bottom)) !important; 
  right: max(16px, env(safe-area-inset-right)) !important; 
}

.close-btn {
  position: absolute; top: 12px; right: 12px; z-index: 10;
  background: rgba(20,20,20,0.9); border: 1px solid var(--border);
  color: white; width: 36px; height: 36px; border-radius: 50%;
  font-size: 16px; cursor: pointer;
  display: flex; justify-content: center; align-items: center;
  transition: background var(--transition-fast), transform var(--transition-fast);
  backdrop-filter: blur(8px);
}
.close-btn:hover, .close-btn:active { background: var(--red); transform: scale(0.9); }

.modal-media-container { width: 100%; background: #000; border-top-left-radius: inherit; border-top-right-radius: inherit; overflow: hidden; }
.modal-body      { padding: 20px; }
.modal-actions   { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.modal-title     { font-size: 1.5rem; font-weight: 800; line-height: 1.2; margin-bottom: 8px; }
.modal-meta      { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stars           { color: var(--red); font-size: 1rem; letter-spacing: 2px; }
.modal-type-badge { font-size: 0.7rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); border: 1px solid rgba(255,255,255,0.15); padding: 2px 8px; border-radius: 3px; }
.modal-description { font-size: 0.9rem; line-height: 1.65; color: var(--text-secondary); margin-top: 8px; }

/* ── INVISIBLE FULLSCREEN INTERCEPTOR ── */
#fullscreen-btn {
  position: absolute; 
  /* I-adjust mo ang bottom at right para sumakto sa native icon ng player */
  bottom: 4px; 
  right: 7px; 
  z-index: 20;
  
  /* Mas malaking tap area para madaling pindutin sa mobile */
  width: 45px; 
  height: 40px; 
  
  /* GINAWA NATING INVISIBLE */
  opacity: 1; 
  background: rgba(255, 0, 0, 0.5); 
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent; /* Tinatanggal yung blue tap effect sa mobile */
}

/* ── 2. FULLSCREEN STATE (Sa Loob) ── */
/* Mas reliable ito dahil Javascript na ang naglalagay ng class! */
#video-wrapper.is-fullscreen #fullscreen-btn { 
  bottom: 12px !important; 
  right: 31px !important; 
}

/* ═══════════════════════════════════════
   TV EPISODES
═══════════════════════════════════════ */
.season-header   { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.episodes-label  { font-size: 1rem; font-weight: 700; }
#season-selector {
  background: var(--bg-elevated); color: var(--text-primary);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 8px 28px 8px 12px; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-family: inherit; outline: none; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23999' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  transition: border-color var(--transition-fast);
}
#season-selector:focus { border-color: rgba(255,255,255,0.3); }

.episode-list {
  display: flex; flex-direction: column; gap: 1px;
  max-height: 340px; overflow-y: auto; overflow-x: hidden;
  border-radius: var(--radius-md);
  scrollbar-width: thin; scrollbar-color: #444 var(--bg-modal);
}
.episode-list::-webkit-scrollbar { width: 4px; }
.episode-list::-webkit-scrollbar-track { background: var(--bg-modal); }
.episode-list::-webkit-scrollbar-thumb { background: #444; border-radius: 10px; }

.episode-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--bg-elevated); cursor: pointer;
  transition: background var(--transition-fast);
  border-left: 3px solid transparent;
}
.episode-item:hover, .episode-item:active { background: rgba(255,255,255,0.06); }
.episode-item.active { border-left-color: var(--red); background: rgba(229,9,20,0.08); }

.episode-thumbnail { width: 96px; height: 54px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; background: var(--bg-card); }
.episode-info      { flex: 1; min-width: 0; }
.episode-info h4   { font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.episode-info p    { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.episode-duration  { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

/* ═══════════════════════════════════════
   SEARCH MODAL
═══════════════════════════════════════ */
.search-modal {
  position: fixed; inset: 0;
  background: rgba(14,14,14,0.98);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  display: none; flex-direction: column; align-items: center;
  z-index: 2000; padding-top: var(--safe-top);
  animation: fadeIn 0.2s ease;
}
.search-modal-header { width: 100%; max-width: 700px; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.search-input-wrap   { flex: 1; position: relative; display: flex; align-items: center; }
.search-icon         { position: absolute; left: 14px; color: var(--text-muted); font-size: 0.9rem; pointer-events: none; }
.search-modal-header input {
  width: 100%; padding: 12px 14px 12px 40px; border-radius: var(--radius-pill);
  border: none; font-size: 1rem; background: rgba(255,255,255,0.08);
  color: var(--text-primary); outline: none; font-family: inherit;
  transition: background var(--transition-fast);
}
.search-modal-header input:focus       { background: rgba(255,255,255,0.12); }
.search-modal-header input::placeholder{ color: var(--text-muted); }
.search-close-btn { background: none; border: none; color: var(--red); font-size: 0.95rem; font-weight: 600; cursor: pointer; padding: 8px; white-space: nowrap; font-family: inherit; }

.results-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px; width: 100%; max-width: 700px; padding: 16px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none; scrollbar-width: none;
}
.results-grid::-webkit-scrollbar { display: none; }
.results-title { grid-column: 1 / -1; font-size: 1rem; font-weight: 700; padding-bottom: 4px; }
.result-card   { position: relative; border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; background: var(--bg-card); aspect-ratio: 2/3; }
.result-card img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition-med); }
.result-card:hover img, .result-card:active img { transform: scale(1.05); }

/* ═══════════════════════════════════════
   SKELETON LOADER
═══════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ═══════════════════════════════════════
   TOAST
═══════════════════════════════════════ */
.toast {
  position: fixed; bottom: calc(20px + var(--safe-bottom)); left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(40,40,40,0.95); color: var(--text-primary);
  padding: 12px 20px; border-radius: var(--radius-pill);
  font-size: 0.875rem; font-weight: 500;
  z-index: 9000; border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  opacity: 0; white-space: nowrap; max-width: 90vw;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* Home infinite scroll sentinel */
.home-sentinel {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════
   FOOTER
═══════════════════════════════════════ */
.footer        { background: var(--bg-primary); color: var(--text-muted); padding: 30px 24px; text-align: center; margin-top: 40px; border-top: 1px solid var(--border); }
.footer-brand  { font-size: 1.2rem; font-weight: 900; color: var(--red); letter-spacing: -0.5px; margin-bottom: 6px; }
.footer-copy   { font-size: 0.8rem; margin-bottom: 14px; }
.footer-links  { display: flex; justify-content: center; gap: 20px; }
.footer-links a{ color: var(--text-muted); text-decoration: none; font-size: 0.8rem; transition: color var(--transition-fast); }
.footer-links a:hover { color: var(--text-primary); }

/* ═══════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════ */
@keyframes fadeIn      { from { opacity: 0; }                                    to { opacity: 1; } }
@keyframes slideUp     { from { opacity: 0; transform: translateY(30px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes slideUpModal{ from { opacity: 0; transform: translateY(40px); }       to { opacity: 1; transform: translateY(0); } }
@keyframes heartbeat   { 0%, 100% { transform: scale(1); }  50% { transform: scale(1.15); } }
@keyframes shimmer     { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ═══════════════════════════════════════
   DESKTOP ENHANCEMENTS
═══════════════════════════════════════ */
@media (min-width: 768px) {
  .navbar         { padding: 18px 48px; }
  .navbar.scrolled{ padding: 12px 48px; }
  .banner-content { padding: 0 48px 48px; }
  .banner-title   { font-size: 3rem; }
  .banner-overview{ font-size: 1rem; -webkit-line-clamp: 4; }
  .section        { padding: 0 48px; }
  .genre-scroll   { padding: 8px 48px; }
  .content-card   { flex: 0 0 160px; height: 240px; }
  .section-title  { font-size: 1.1rem; }
}
@media (min-width: 1200px) {
  .content-card { flex: 0 0 200px; height: 300px; }
}

/* ═══════════════════════════════════════
   REDUCED MOTION
═══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── TITLE + TYPE OVERLAYS (Movie / TV / Anime) ── */
.card-info-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 34px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: linear-gradient(to top, rgba(0,0,0,0.92), rgba(0,0,0,0));
  pointer-events: none;
}
.card-title-text {
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.15;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-type-badge,
.result-type {
  align-self: flex-start;
  background: rgba(229,9,20,0.92);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.result-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 38px 8px 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.95), rgba(0,0,0,0));
}
.result-meta strong {
  color: #fff;
  font-size: 0.72rem;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.content-card:focus-visible,
.result-card:focus-visible,
.category-card:focus-visible,
.episode-item:focus-visible,
.genre-btn:focus-visible,
.action-btn:focus-visible,
.back-btn:focus-visible,
.scroll-btn:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}
