@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

.dropdown-menu {
  width: 300px;
  position: absolute;
  left: auto;
  right: 0;
  top: 110%;
  font-size: 14px;
  box-shadow: 0 5px 5px rgba(0,0,0,.05);
  background-color: rgba(36,36,40,.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  padding: 0;
  margin: 0;
  padding-bottom: 10px;
  border-radius: 1rem;
  border: 1px solid rgba(255,255,255,.1);
  overflow: hidden;
  z-index: 3000;
}

/* ===== Responsive: Global (Tablets & Phones) ===== */
@media (max-width: 992px) {
  main { padding: 1.25em; }
  .logo { height: 42px; max-width: 140px; }
}

@media (max-width: 768px) {
  .logo { height: 38px; max-width: 128px; }
  .hamburger { width: 42px; height: 42px; }
  .hamburger span { width: 22px; }
  main { padding: 1em; }
  /* Sidebar slides in as wider percentage panel on phones */
  .sidebar { width: 82vw; left: -90vw; }
  .sidebar.open { left: 0; }
  /* Genres flyout should not enforce large min width on phones */
  .sidebar-flyout-inner { min-width: 0; max-width: 75vw; width: min(75vw, 200px); overflow-x: hidden; }
}

@media (max-width: 600px) {
  /* Home cards scale to viewport width */
  .show-card { width: 46vw; }
  .show-card img { height: calc(46vw * 1.5); }
  .home-row-scroller { gap: 8px; padding: 6px 4px; }
  .profile-dropdown { right: 6px; min-width: 200px; }
}

@media (max-width: 420px) {
  .show-card { width: 64vw; }
  .show-card img { height: calc(64vw * 1.5); }
  #signInBtn { padding: 0.45em 0.9em; font-size: 0.95em; }
}

/* Profile/Dashboard section title */
.dashboard-section-title {
  margin: 0 0 0.6em 0;
  padding-right: 2.8rem; /* leave space for close button */
  font-size: 1.6rem; /* smaller to avoid overlap */
  line-height: 1.25;
  color: var(--text-color);
  font-weight: 800;
}
.dropdown-menu-right { right: 0; left: auto; }
.dropdown-item {
  padding: 1rem;
  background: none !important;
  color: #fff;
  display: block;
  border: none;
  text-align: left;
  width: 100%;
  transition: color 0.15s;
  font-size: 1em;
  text-decoration: none;
}
.dropdown-item:hover, .dropdown-item:focus {
  color: #ffdd95 !important;
  background: none !important;
  outline: none;
}
.dropdown-item-user {
  padding: 12px 15px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #eee;
  background: none !important;
}
.user-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 5px;
  color: #ffdd95;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.mail {
  color: #fff;
  font-size: 13px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.grid-menu {
  display: flex;
  flex-direction: column;
}
.text-right { text-align: right; }
.text-white { color: #fff !important; }
.clearfix::after { content: ''; display: block; clear: both; }


:root {
  --background-color: #F5F5F5;
  --cards: #ffffff;
  --button-bg: #f8f4f4;
  --header-color: #ffffff;
  --text-color: #000000; /* Light mode text: black */
  --button-color: #f5f5f5;
  /* Form + UI tokens */
  --input-bg: #ffffff;
  --input-border: #dddddd;
  --muted-text: #666666;
  /* Accent tokens */
  --accent: #ffd54f;
  --accent-contrast: #181818;
  --accent-muted: #ffea9a;
}
:root.dark {
  --background-color: #242525;
  --cards: #27292b;
  --button-bg: #1f2022;
  --header-color: #121212;
  --text-color: #ffffff; /* Dark mode text: white */
  --button-color: #23232B;
  /* Form + UI tokens */
  --input-bg: #23232b;
  --input-border: #333333;
  --muted-text: #bbbbbb;
  /* Accent tokens */
  --accent: #ffd54f;
  --accent-contrast: #181818;
  --accent-muted: #6b5b00;
}
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--background-color);
  color: var(--text-color);
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* ----- Sidebar Genres Flyout ----- */
.sidebar-flyout {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1800;
  pointer-events: none;
}
.sidebar-flyout.hidden { display: none; }
.sidebar-flyout.show { display: block; pointer-events: auto; }
.sidebar-flyout-inner {
  background: rgba(24,24,24,0.98);
  color: #fff;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 12px 36px rgba(0,0,0,0.28);
  min-width: 300px;
  max-width: min(92vw, 840px);
  max-height: 80vh; /* give more vertical space */
  overflow-y: auto;
  overflow-x: hidden; /* avoid horizontal scroll */
}
.sidebar-flyout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-weight: 700;
}
.sidebar-flyout .flyout-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
}
.sidebar-flyout .flyout-close:hover { background: rgba(255,255,255,0.08); }
.genre-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 6px 22px;
  padding: 12px 16px 16px 16px;
}
/* When opened from sidebar, make grid denser vertically */
.sidebar-flyout .genre-grid { grid-template-columns: repeat(3, 1fr); gap: 8px 16px; }
@media (max-width: 900px) { .genre-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .genre-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) {
  .sidebar-flyout-inner { max-height: 82vh; }
  .sidebar-flyout-header { padding: 8px 12px; font-size: 0.95em; }
  .sidebar-flyout .genre-grid { grid-template-columns: repeat(2, 1fr); gap: 6px 12px; padding: 10px 12px 12px; }
  .sidebar-flyout .genre-link { font-size: 0.92em; padding: 6px 6px; }
}
@media (max-width: 520px) { .sidebar-flyout .genre-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) {
  .sidebar-flyout-header { font-size: 0.9em; }
  .sidebar-flyout .genre-link { font-size: 0.88em; padding: 4px 6px; line-height: 1.15; }
}
@media (max-width: 420px) {
  .sidebar-flyout .genre-grid { grid-template-columns: 1fr; }
  .sidebar-flyout .genre-link { font-size: 0.86em; padding: 4px 6px; }
}
@media (max-width: 360px) {
  .sidebar-flyout .genre-link { font-size: 0.82em; padding: 4px 6px; }
}
.genre-link {
  color: #ddd;
  text-decoration: none;
  padding: 6px 6px;
  border-radius: 6px;
  display: block;
  font-size: 0.98em;
}
.genre-link:hover, .genre-link:focus {
  color: var(--accent);
  background: rgba(255,255,255,0.06);
  outline: none;
}
.genre-empty { padding: 14px; color: #bbb; }


.profile-avatar-nav {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;

  border: 2px solid #ffd54f;
  box-shadow: 0 2px 8px rgba(0,0,0,0.09);
  transition: box-shadow 0.2s, border 0.2s;
  display: block;
  max-width: 100%;
}

@media (max-width: 600px) {
  .profile-avatar-nav {
    width: 32px;
    height: 32px;
    border-width: 1.5px;
  }
}

@media (max-width: 400px) {
  .profile-avatar-nav {
    width: 28px;
    height: 28px;
    border-width: 1px;
  }
}

.profile-dropdown {
  position: absolute;
  top: 55px;
  right: 0;
  min-width: 220px;
  background: #181818;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  z-index: 3000;
  padding: 0.5em 0;
  display: none;
  animation: fadeIn 0.18s;
}
.profile-dropdown-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.profile-dropdown-link {
  display: flex;
  align-items: center;
  gap: 0.75em;
  padding: 0.9em 1.4em;
  color: #fff;
  text-decoration: none;
  font-size: 1.08em;
  border: none;
  background: none;
  transition: background 0.13s, color 0.13s;
  cursor: pointer;
  border-radius: 8px;
}
.profile-dropdown-link:hover, .profile-dropdown-link:focus {
  background: #232323;
  color: #ffd54f;
  outline: none;
}
.profile-dropdown-link.logout {
  color: #ff5252;
}
.profile-dropdown-link.logout:hover, .profile-dropdown-link.logout:focus {
  background: #232323;
  color: #fff;
}
.profile-dropdown-header {
  text-align: left;
  padding: 0 1.2em 0.7em 1.2em;
  border-bottom: 1px solid #333;
  margin-bottom: 0.3em;
}
.profile-dropdown-username {
  color: #ffd54f;
  font-weight: bold;
  font-size: 1.12em;
  display: block;
  margin-bottom: 0.1em;
}
.profile-dropdown-email {
  color: #bbb;
  font-size: 0.97em;
  word-break: break-all;
}
.profile-dropdown-btn {
  background: none;
  border: none;
  text-align: left;
  padding: 0.85em 1.5em;
  font-size: 1.04em;
  color: #eee;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  display: flex;
  align-items: center;
  gap: 0.7em;
  font-family: inherit;
}
.profile-dropdown-btn:hover, .profile-dropdown-btn:focus {
  background: #29293a;
  color: #ffd54f;
}
.profile-dropdown-btn.logout {
  color: #ff5252;
  margin-top: 0.6em;
  justify-content: flex-end;
  font-weight: bold;
}
.profile-dropdown-btn.logout:hover {
  background: #29293a;
  color: #fff;
}
@media (max-width: 600px) {
  .profile-dropdown {
    min-width: 200px;
    right: 0.5em;
    top: 52px;
    padding: 0.9em 0 0.5em 0;
  }
  .profile-dropdown-header {
    padding: 0 0.8em 0.6em 0.8em;
  }
  .profile-dropdown-btn {
    padding: 0.7em 1em;
    font-size: 0.98em;
  }
}

.site-header, header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--header-color);
    color: var(--text-color);
    padding: 0.5em 1em;
    position: relative;
    transition: background-color 0.4s, color 0.4s;
}
.site-header, header { box-sizing: border-box; width: 100%; overflow-x: clip; }
html, body { max-width: 100%; overflow-x: hidden; }
.header-right {
  display: flex;
  align-items: center;

    display: flex;
    align-items: center;
    margin-left: 1em;
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.5em;
}
.header-center { display: flex; align-items: center; justify-content: center; flex: 1 1 auto; min-width: 0; }
.header-left, .header-right { flex: 0 1 auto; min-width: 0; flex-shrink: 1; overflow: hidden; }
.header-right > * { max-width: 100%; }
.site-header > * { min-width: 0; }
@media (max-width: 600px) {
  .logo { max-width: 120px; height: auto; }
  .header-right { gap: 8px; }
  .site-header { padding: 0.4em 0.6em; }
  #signInBtn { margin-left: 0.5em !important; }
}
@media (max-width: 380px) {
  .logo { max-width: 100px; }
  #signInBtn { margin-left: 0.4em !important; }
}
@media (max-width: 340px) {
  #signInBtn { padding: 0.3em 0.6em !important; font-size: 0.84em !important; }
}

/* Blur effect for main content when sidebar is open */
.blur {
    filter: blur(6px);
    pointer-events: none;
    user-select: none;
}

/* Modal Overlay for registration */
.modal-overlay {
    position: fixed;
    inset: 0; /* avoid 100vw/100vh seams on some devices */
    background: rgba(20, 20, 20, 0.65);
    backdrop-filter: blur(6px);
    z-index: 2000;
    transition: opacity 0.3s;
}

/* Registration Modal Styles */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    background: var(--cards);
    color: var(--text-color);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25), 0 1.5px 8px rgba(0,0,0,0.15);
    min-width: 350px;
    max-width: 480px;
    width: 90vw;
    padding: 2.2em 2em 1.5em 2em;
    z-index: 2001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.4s, color 0.4s;
}
.modal[style*='display: block'], .modal.show {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}
@keyframes splashIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.7);
        box-shadow: 0 0 0 rgba(0,0,0,0.0);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.08);
        box-shadow: 0 12px 36px rgba(0,0,0,0.18);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    }
}

.modal-title {
    text-align: center;
    font-size: 1.6em;
    font-weight: bold;
    margin-bottom: 1.2em;
}
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 0.9em;
}
.modal-form label {
    font-size: 0.97em;
    font-weight: 600;
    margin-bottom: 0.2em;
    color: var(--text-color);
    letter-spacing: 0.01em;
}
.modal-form input[type="text"],
.modal-form input[type="email"],
.modal-form input[type="password"],
.modal-form input[type="file"] {
    padding: 0.7em 1em;
    border-radius: 10px;
    border: 1.5px solid #ddd;
    background: var(--background-color);
    color: var(--text-color);
    font-size: 1em;
    outline: none;
    margin-bottom: 0.2em;
    transition: border 0.2s;
}
.modal-form input:focus {
    border-color: #a3d8ff;
}
.modal-btn {
    margin-top: 1.2em;
    width: 100%;
    padding: 0.8em 0;
    font-size: 1.1em;
    border-radius: 12px;
    background: linear-gradient(90deg, #ffe082 0%, #ffd54f 100%);
    color: #222;
    font-weight: bold;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.modal-btn:hover, .modal-btn:focus {
    background: linear-gradient(90deg, #ffe082 0%, #fff176 100%);
    color: #111;
}
.modal-close {
    position: absolute;
    top: 14px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2em;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 2200;
}
.modal-close:hover, .modal-close:focus {
    color: #ffb300;
}
.modal-footer {
    text-align: center;
    margin-top: 1.4em;
    font-size: 1em;
    color: #bbb;
}
.modal-footer a {
    color: #ffd54f;
    text-decoration: none;
    font-weight: 600;
    margin-left: 0.3em;
    transition: color 0.2s;
}
.modal-footer a:hover {
    color: #ffc107;
}
@media (max-width: 600px) {
    .modal {
        min-width: 90vw;
        width: 97vw;
        padding: 1.2em 0.7em 1.2em 0.7em;
    }
    .modal-title {
        font-size: 1.2em;
    }
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}
.logo {
    height: 48px;
    max-width: 160px;
    object-fit: contain;
}
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-right: 0.25em;
    align-items: center;
    transition: background 0.3s;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 3px;
    margin: 3px 0;
    background: var(--text-color);
    border-radius: 2px;
    transition: 0.3s;
}
.dark-mode-toggle img {
    width: 48px;
    height: 48px;
    pointer-events: none;
    border-radius: 8px;
    transition: opacity 0.3s, filter 0.3s, border-radius 0.3s;
}
/* Ensure dark mode toggle is always visible and tappable */
.dark-mode-toggle {
    position: fixed;
    right: calc(14px + env(safe-area-inset-right));
    bottom: calc(14px + env(safe-area-inset-bottom));
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500; /* above sidebar overlay (1000) and below modals (2000+) */
    cursor: pointer;
}
.dark-mode-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
@media (max-width: 768px) { .dark-mode-toggle { right: calc(12px + env(safe-area-inset-right)); bottom: calc(12px + env(safe-area-inset-bottom)); } }
@media (max-width: 600px) { .dark-mode-toggle { right: calc(10px + env(safe-area-inset-right)); bottom: calc(10px + env(safe-area-inset-bottom)); } }
@media (max-width: 380px) { .dark-mode-toggle { right: calc(8px + env(safe-area-inset-right)); bottom: calc(8px + env(safe-area-inset-bottom)); } }
/* Larger viewports: float a bit further from edges */
@media (min-width: 1024px) { .dark-mode-toggle { right: 20px; bottom: max(20px, 3vh); } }
@media (min-width: 1440px) { .dark-mode-toggle { right: 28px; bottom: max(28px, 3.5vh); } }
@media (min-height: 900px) { .dark-mode-toggle { bottom: clamp(16px, 4vh, 56px); } }
.search-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.2em;
    cursor: pointer;
    margin-left: 0.25em;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}
.search-btn .fa {
    color: var(--text-color) !important;
    transition: color 0.3s;
}

/* --- Global Search Overlay --- */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,20,20,0.55);
  backdrop-filter: blur(4px);
  z-index: 2400;
  display: none;
}
.search-overlay.show { display: block; }
.search-center {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, 92vw);
  padding: 0 14px;
}
.search-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.22);
}
.search-bar input[type="search"] {
  background: transparent;
  color: var(--text-color);
  border: none;
  padding: 12px 14px;
  font-size: 1.02rem;
  outline: none;
}
.search-bar button {
  background: var(--cards);
  border-left: 1.5px solid var(--input-border);
  padding: 0 14px;
  display: flex; align-items: center; justify-content: center;
}
.search-results {
  margin-top: 10px;
  background: var(--cards);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  overflow: hidden;
}
.search-results .result-item {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--input-border) 70%, transparent);
  cursor: pointer;
}
.search-results .result-item:last-child { border-bottom: none; }
.search-results .result-item:hover { background: color-mix(in srgb, var(--button-bg) 60%, transparent); }
.search-results .result-item.selected { background: color-mix(in srgb, var(--button-bg) 80%, transparent); }
.search-results img { width: 54px; height: 72px; object-fit: cover; border-radius: 6px; background:#1f1f24; }
.search-results .title { font-weight: 700; color: var(--text-color); }
.search-results .meta { font-size: .9em; color: var(--muted-text); }
.search-results .badge { font-size: .78em; opacity: .85; padding: 3px 6px; border-radius: 999px; border: 1px solid var(--input-border); }

.search-results .section-label {
  padding: 8px 10px;
  font-size: .82em;
  color: var(--muted-text);
  opacity: .9;
  background: color-mix(in srgb, var(--cards) 90%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--input-border) 70%, transparent);
}

@media (max-width: 520px) {
  .search-center { top: 12%; }
  .search-bar input[type="search"] { padding: 10px 12px; font-size: 1rem; }
}

footer {
    background: var(--header-color);
    color: var(--text-color);
    padding: 1em 0;
    text-align: center;
    transition: background-color 0.4s, color 0.4s;
}
main {
    padding: 2em;
}
section {
    margin-bottom: 2em;
}
button {
    padding: 0.5em 1em;
    font-size: 1em;
    background: var(--button-bg);
    color: var(--button-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
}
/* Remove hover effect */
/* button:hover { background: #0056b3; } */

/* Watch page: Watchlist button (high contrast for both themes) */
.watchlist-btn {
  appearance: none;
  -webkit-appearance: none;
  font-weight: 700;
  border-radius: 10px;
  padding: 0.55em 1em;
  border: 1.8px solid var(--accent);
  background: transparent;
  color: var(--accent);
  letter-spacing: 0.01em;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.watchlist-btn:hover, .watchlist-btn:focus-visible {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  outline: none;
}
.watchlist-btn.active {
  background: var(--accent);
  color: var(--accent-contrast) !important;
  border-color: var(--accent);
}
.watchlist-btn:disabled { opacity: 0.75; cursor: wait; }


#signInBtn {
    margin-left: 0.5em;
    font-weight: bold;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5em 1em;
    background: black !important;
    color: #fff !important;
    font-size: 1em;
    letter-spacing: 0.02em;
    transition: background 0.3s, color 0.3s, border 0.3s;
    white-space: nowrap;
}

#sidebar #sidebarSignInBtn {
    position: absolute;
    right: 24px;
    bottom: 24px;
    margin: 0 5px 25px 0;
    font-weight: bold;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5em 1em;
    background: black !important;
    color: #fff !important;
    font-size: 1em;
    letter-spacing: 0.02em;
    transition: background 0.3s, color 0.3s, border 0.3s;
    white-space: nowrap;
    width: fit-content;
    z-index: 1100;
}

.dark-mode-toggle {
    position: fixed;
    left: 10px;
    bottom: 10px;
    width: 48px;
    height: 48px;
    background: #000;
    border: 2px solid #fff;
    border-radius: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 10px;
    transition: all 0.3s ease;
    z-index: 2000;
}
@media (max-width: 600px) {
  .dark-mode-toggle {
    left: 10px;
    bottom: 10px;
    right: auto;
  }
}

/* Modal Overlay and Container Styles */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0; /* use inset pattern */
  background: rgba(30,30,40,0.45);
  backdrop-filter: blur(6px);
  z-index: 1000;
  transition: opacity 0.2s;
}
.modal-container {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(1);
  background: var(--cards, #23232b);
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 1010;
  padding: 2.5em 2em 2em 2em;
  min-width: 320px;
  max-width: 95vw;
  max-height: 95vh;
  overflow-y: auto;
  overflow-x: hidden; /* prevent sideways scroll */
  box-sizing: border-box;
  opacity: 1;
  transition: opacity 0.22s, transform 0.22s;
}
.modal-container.hide {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.96);
  pointer-events: none;
}
.modal-overlay.hide {
  opacity: 0;
  pointer-events: none;
}

/* Dashboard Modal Animation */
.dashboard-modal-animate {
  animation: dashboardPopIn 0.44s cubic-bezier(.42,1.4,.58,1);
}
@keyframes dashboardPopIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -53%) scale(0.92);
    box-shadow: 0 0 0 rgba(0,0,0,0.0);
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 16px 48px rgba(0,0,0,0.18);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  }
}

/* Dashboard menu active item */
.dashboard-list li.active {
  font-weight: 700;
  color: var(--primary, #ffb347);
}

/* Dashboard content fade/slide */
.dashboard-section-content {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.36s, transform 0.36s;
}
.dashboard-section-content.active {
  opacity: 1;
  transform: translateY(0);
}

/* Safety: avoid child elements causing overflow */
.dashboard-modal-content *,
.modal-container * {
  max-width: 100%;
  box-sizing: border-box;
}
/* Prevent images or long strings from pushing layout */
.dashboard-modal-content img { max-width: 100%; height: auto; }

/* Dashboard Modal Modern Styles */
.dashboard-modal-content {
    min-width: 460px;
    max-width: 720px;
    background: var(--cards, #23232b);
    border-radius: 16px;
    padding: 1rem 1.6rem 1.6rem 1.6rem;
    display: flex;
    gap: 1.4rem;
    align-items: flex-start;
    position: relative;
    box-sizing: border-box;
    overflow-x: hidden; /* prevent sideways scroll */
}
.dashboard-close {
  position: absolute;
  top: 1.2rem;
  right: 1.6rem;
  background: none;
  border: none;
  font-size: 2em;
  color: #aaa;
  cursor: pointer;
  z-index: 2200;
  transition: color 0.2s;
}
.dashboard-close:hover {
  color: #ffd54f;
}
.dashboard-list {
  min-width: 160px;
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1em;
  font-size: 1.06em;
}
.dashboard-list li {
  color: var(--text-color);
  padding: 0.5em 1em;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.dashboard-list li.active,
.dashboard-list li:hover {
  background: var(--button-color);
  color: #ffd54f;
  font-weight: bold;
}
.dashboard-section-content {
  flex: 1 1 0%;
  padding-left: 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: 100%;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.dashboard-section-content h2 {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 1em;
  color: var(--text-color);
}
.dashboard-profile-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1em;
  width: 100%;
  max-width: 300px;
  box-sizing: border-box;
  overflow-x: hidden;
}
.dashboard-profile-form label {
  font-size: 1em;
  font-weight: 600;
  margin-bottom: 0.35em;
  color: var(--accent);
  align-self: flex-start;
}
.dashboard-profile-form input {
  width: 100%;
  padding: 0.6em 1em;
  border-radius: 7px;
  border: 1.5px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-color);
  font-size: 1em;
  margin-bottom: 1em;
}
.dashboard-profile-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}
.dashboard-profile-form input[readonly] {
  color: var(--muted-text);
  opacity: 0.8;
}
.profile-btn-group {
  display: flex;
  gap: 1em;
  width: 100%;
  margin-top: 1.2em;
  justify-content: center;
}

/* Button base */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--button-bg);
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: filter .18s, box-shadow .18s, transform .18s, background .18s, color .18s, border-color .18s;
}
.btn:hover, .btn:focus-visible { filter: brightness(1.05); box-shadow: 0 6px 18px rgba(0,0,0,0.14); }
.btn:active { transform: translateY(1px); box-shadow: 0 3px 12px rgba(0,0,0,0.12); }

/* Colorful buttons and inputs */
.btn-accent {
  background: linear-gradient(90deg, var(--accent) 0%, #ffcd38 100%);
  color: var(--accent-contrast) !important;
  border: none;
}
.btn-accent:hover, .btn-accent:focus {
  filter: brightness(1.05);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}
.btn-outline {
  background: var(--button-bg);
  color: var(--text-color) !important;
  border: 1.5px solid var(--input-border) !important;
}
.btn-outline:hover, .btn-outline:focus {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}
.input {
  background: var(--input-bg);
  color: var(--text-color);
  border: 1.5px solid var(--input-border);
  border-radius: 7px;
  padding: 0.6em 1em;
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}
@media (max-width: 900px) {
  .modal-container { width: 94vw; max-width: 94vw; min-width: auto; }
  .dashboard-modal-content {
    flex-direction: column;
    width: 94vw;
    min-width: auto;
    max-width: 94vw;
    padding: 1.2rem 1rem 1rem 1rem; /* extra top/right padding for close button */
    gap: 1rem;
    margin: 0 auto;
  }
  .dashboard-section-content {
    padding-left: 0;
    width: 100%;
    padding-right: 0;
    max-width: 360px; /* center narrow column */
    margin: 0 auto;   /* center within modal */
  }
  .dashboard-list {
    flex-direction: row;
    flex-wrap: wrap; /* wrap instead of horizontal scroll */
    gap: 0.6em;
    min-width: 0;
    font-size: 0.98em;
    justify-content: center;
    overflow-x: hidden;
    white-space: normal;
    width: 100%;
  }
}

/* ===== Responsive: Auth Modals (Login, Register, Forgot) ===== */
@media (max-width: 768px) {
  .modal { width: 92vw; max-width: 92vw; padding: 1.8em 1.2em 1.2em 1.2em; border-radius: 18px; }
  .modal-title { font-size: 1.4em; }
  .modal-form { gap: 0.85em; }
  .modal-btn { font-size: 1.02em; padding: 0.75em 0; }
}
@media (max-width: 600px) {
  .modal { width: 92vw; max-width: 92vw; min-width: auto; max-height: 86vh; padding: 1.2em 1em; border-radius: 16px; transform: translate(-50%, -50%) scale(1); }
  .modal-title { font-size: 1.25em; margin-bottom: 1em; }
  .modal-form label { font-size: 0.95em; }
  .modal-form input[type="text"],
  .modal-form input[type="email"],
  .modal-form input[type="password"],
  .modal-form input[type="file"] { font-size: 0.98em; padding: 0.65em 0.9em; }
  .modal-btn { font-size: 1em; padding: 0.7em 0; }
  .modal-footer { row-gap: 0.5em; }
}
@media (max-width: 380px) {
  .modal { width: 96vw; max-width: 96vw; min-width: auto; max-height: 80vh; padding: 1em 0.85em; border-radius: 12px; }
  .modal-title { font-size: 1.1em; }
}

/* ===== Responsive: Dashboard Modal tweaks for small screens ===== */
@media (max-width: 680px) {
  .dashboard-modal-content { padding: 1rem 0.9rem; gap: 0.9rem; }
  .dashboard-list { font-size: 0.95em; }
  .dashboard-close { top: 0.55rem; right: 0.75rem; font-size: 1.5em; }
  .dashboard-section-content h2 { font-size: 1.28rem; }
  .dashboard-profile-form { max-width: 320px; margin: 0 auto; }
}
@media (max-width: 480px) {
  .dashboard-modal-content {
    border-radius: 14px;
    width: min(92vw, 420px); /* tighter width for perfect centering */
    padding-right: 1.6rem;   /* extra space for close button */
    margin-left: auto; margin-right: auto;
  }
  .dashboard-close { top: 10px; right: 10px; z-index: 2; }
  .dashboard-list {
    gap: 0.55em;
    padding: 0 12px; /* stronger side gutters */
    margin-top: 10px;
    max-width: 420px;
    margin-left: auto; margin-right: auto;
  }
  .dashboard-section-content h2 { font-size: 1.16rem; }
  .dashboard-section-content { padding-left: 8px; padding-right: 8px; max-width: 340px; }
  .dashboard-profile-form { max-width: 320px; }
}

/* ===== Dashboard: Mobile pill grid menu and compact layout ===== */
@media (max-width: 480px) {
  /* Pill grid menu */
  .dashboard-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columns for more space */
    gap: 12px;
    padding: 0 12px;
  }
  .dashboard-list li {
    text-align: center;
    border-radius: 999px;
    padding: 10px 10px;
    font-size: 0.95em;
    background: color-mix(in srgb, var(--button-bg) 60%, transparent);
    border: 1px solid var(--input-border);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0; /* allow ellipsis without grid overflow */
  }
  .dashboard-list li.active {
    background: var(--button-color);
    color: #111;
  }
  .dashboard-list li i { margin-right: 6px; }

  /* Condensed header area */
  .dashboard-section-content h2 {
    margin-bottom: 10px;
  }

  /* Avatar row polish */
  .dashboard-profile-form img {
    width: 60px; height: 60px; border-radius: 50%;
  }
  #changeAvatarBtn {
    border: 1px solid var(--input-border) !important;
    background: var(--button-bg) !important;
    color: var(--text-color) !important;
    padding: 6px 10px !important;
    border-radius: 999px !important;
    font-size: 0.92em !important;
  }

  /* Form density and button stacking */
  .dashboard-profile-form label { font-size: 0.95em; }
  .dashboard-profile-form input { padding: 0.55em 0.9em; }
  .profile-btn-group { flex-direction: column; gap: 8px; width: 100%; }
  .profile-btn-group .btn, .profile-btn-group .btn-accent { width: 100%; }
}

/* Inner card to keep content off edges */
.dashboard-card {
  background: color-mix(in srgb, var(--cards) 95%, transparent);
  border-radius: 12px;
  padding: 14px;
}

/* Button helpers */
.btn-full { width: 100%; display: inline-flex; justify-content: center; }
.btn-text {
  background: transparent !important;
  border: none !important;
  color: var(--muted-text) !important;
  padding: 8px 4px !important;
  text-decoration: underline;
  border-radius: 6px;
}

/* Extra compact dashboard modal on smaller phones */
@media (max-width: 600px) {
  .dashboard-modal-content { padding: 0.75rem 0.5rem; border-radius: 14px; }
  .dashboard-list { font-size: 0.92em; gap: 0.45em; }
  .dashboard-list li { padding: 0.42em 0.75em; }
  .dashboard-section-content h2 { font-size: 1.1rem; margin-bottom: 0.85em; }
  .dashboard-profile-form { max-width: 280px; gap: 0.85em; }
  .dashboard-profile-form input { font-size: 0.96em; padding: 0.5em 0.85em; }
  .profile-btn-group { gap: 0.55em; }
}
@media (max-width: 380px) {
  .dashboard-modal-content { padding: 0.8rem 0.8rem; border-radius: 12px; }
  .dashboard-list { font-size: 0.88em; gap: 0.4em; }
  .dashboard-list li { padding: 0.38em 0.65em; }
  .dashboard-section-content h2 { font-size: 1.03rem; }
  .dashboard-section-content { padding-left: 8px; padding-right: 8px; max-width: 320px; }
}
/* Ensure dashboard content never exceeds viewport */
@media (max-width: 768px) {
  .dashboard-modal-content { max-height: 88vh; overflow: auto; }
}

/* ===== Compact header Sign In button on small screens ===== */
@media (max-width: 768px) {
  #signInBtn { padding: 0.45em 0.9em; font-size: 0.95em; border-radius: 8px; }
}
@media (max-width: 600px) {
  #signInBtn { padding: 0.4em 0.8em !important; font-size: 0.9em !important; }
}
@media (max-width: 380px) {
  #signInBtn { padding: 0.35em 0.7em !important; font-size: 0.86em !important; }
}



/* Home rows (Netflix-like) */
.home-row { margin: 24px 0; }
.home-row-title { font-size: 1.2rem; font-weight: 700; margin: 0 0 10px 6px; color: var(--text-color, #eee); }
.home-row-scroller { display: flex; gap: 10px; overflow-x: auto; padding: 6px; scroll-snap-type: x mandatory; }
.home-row-scroller::-webkit-scrollbar { height: 8px; }
.home-row-scroller::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 8px; }
.show-card { flex: 0 0 auto; width: 160px; border-radius: 10px; overflow: hidden; background: rgba(255,255,255,0.06); position: relative; scroll-snap-align: start; }
.show-card img { width: 100%; height: 240px; object-fit: cover; display: block; }
.show-card .card-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,0.75) 100%); }
.show-card .card-title { position: absolute; left: 8px; right: 8px; bottom: 8px; color: #fff; font-size: 0.9rem; font-weight: 600; text-shadow: 0 2px 8px rgba(0,0,0,0.6); }
.show-card .progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,0.2); }
.show-card .progress > span { display: block; height: 100%; background: var(--accent, #ffd54f); width: 0%; }
.show-card:hover { transform: translateY(-2px); transition: transform .15s ease; }

/* Sidebar styles */
.sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    width: 240px;
    height: 100%;
    background: var(--cards);
    color: var(--text-color);
    box-shadow: 2px 0 8px rgba(0,0,0,0.2);
    transition: left 0.3s, background-color 0.4s, color 0.4s;
    z-index: 1001;
    padding-top: 32px;
    padding-left: 0;
    padding-right: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
.sidebar ul {
    flex: 1 1 auto;
    overflow-y: auto;
    margin-bottom: 0;
}
.sidebar-bottom {
    margin-top: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 24px;
    gap: 12px;
}
.sidebar-bottom {
    margin-top: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 24px;
    gap: 12px;
}



.sidebar-close-btn {
    display: block;
    width: 90%;
    margin: 16px auto 12px auto;
    padding: 10px 18px;
    background: var(--button-bg);
    color: var(--text-color);
    border: none;
    border-radius: 999px;
    font-size: 1em;
    font-weight: bold;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    outline: none;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.sidebar-close-btn:hover, .sidebar-close-btn:focus {
    background: var(--background-color);
    color: var(--text-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.sidebar.open {
    left: 0;
}
.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar ul li {
    margin: 1.5em 0;
    text-align: left;
    padding-left: 1.5em;
}
.sidebar ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1em;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    transition: color 0.2s;
    padding-left: 24px;
}
.sidebar ul li a i {
    margin-right: 14px;
    font-size: 1.15em;
    display: inline-block;
    vertical-align: middle;
}
.sidebar ul li a:active {
    color: #007bff;
}

/* Overlay for sidebar */
#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0; /* avoid 100vw/100vh seam on foldables */
    background: rgba(0,0,0,0.3);
    z-index: 1000;
}
#sidebar.open + #sidebar-overlay {
    display: block;
}

/* Dashboard Modal List Hover Effect */
.dashboard-list li {
  transition: font-size 0.3s, font-weight, transform 0.3s;
  cursor: pointer;
}
.dashboard-list li:hover {
  font-weight: bold;
  transform: scale(1.09);
  z-index: 1;
}

/* ===== Shared Pager (Search/Genre) ===== */
.pager { display:flex; justify-content:center; margin:18px 0 8px; }
.pager-inner { display:flex; gap:10px; }
.page-btn {
  min-width: 36px; height: 36px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--input-border);
  background: color-mix(in srgb, var(--cards) 65%, transparent);
  color: var(--muted-text);
  display: inline-flex; align-items:center; justify-content:center;
  font-weight: 600;
}
.page-btn:hover { filter: brightness(1.06); }
.page-btn.current { background: #ffe082; color: #111; border-color: #f7cc53; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.page-btn:disabled { opacity: .45; cursor: default; filter: none; }

/* ===== Home Spotlight Hero ===== */
.home-hero { position: relative; border-radius: 14px; overflow: hidden; min-height: 420px; margin: 16px 0 12px; }
.home-hero-bg {
  position: absolute; inset: 0;
  background-size: cover; /* fill hero area */
  background-position: center right 15%; /* bias to right so content has space on left */
  /* no blur — show original image */
}
.home-hero-shade {
  position: absolute; inset: 0;
  /* left-to-right soft gradient + right vignette + bottom fade */
  background:
    radial-gradient(60% 70% at 85% 50%, rgba(0,0,0,0.0) 0%, rgba(0,0,0,0.55) 60%, rgba(0,0,0,0.75) 100%),
    linear-gradient(90deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.40) 28%, rgba(0,0,0,0.20) 52%, rgba(0,0,0,0.45) 86%),
    linear-gradient(180deg, rgba(0,0,0,0.00) 0%, rgba(0,0,0,0.55) 100%);
}
.home-hero-content {
  position: relative; z-index: 1; padding: 40px 28px; max-width: 900px;
}
.hero-eyebrow { color: #ffe082; font-weight: 700; margin-bottom: 6px; }
.hero-title { font-size: clamp(1.8rem, 4.6vw, 2.8rem); margin: 6px 0 10px; }
.hero-desc { color: var(--muted-text); max-width: 70ch; line-height: 1.5; }
.hero-actions { display:flex; gap: 10px; margin-top: 14px; }
.hero-actions .btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; padding: 12px 18px; border-radius: 12px; }
.btn.primary.hero-watch { background: #ffe082; color: #111; border-color: #f7cc53; box-shadow: 0 4px 18px rgba(0,0,0,.25); text-decoration: none; font-weight: 700; }
.btn.primary.hero-watch:hover { filter: brightness(1.05); box-shadow: 0 6px 22px rgba(0,0,0,.28); }
.btn.primary.hero-watch:active { transform: translateY(1px); }
.btn.text.hero-detail { background: color-mix(in srgb, var(--cards) 55%, transparent); border: 1px solid var(--input-border); color: var(--muted-text); }

/* Spotlight controls: dots + chevron */
.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}
.hero-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.45);
  border: 1px solid rgba(0,0,0,0.25);
  outline: none;
  cursor: pointer;
  padding: 0;
  transition: transform .18s, background .18s;
}
.hero-dots .dot:hover, .hero-dots .dot:focus-visible { background: #fff; transform: scale(1.15); }
.hero-dots .dot.active { background: var(--accent); border-color: color-mix(in srgb, var(--accent-contrast) 18%, transparent); transform: scale(1.2); }

.hero-nav {
  position: absolute;
  right: 14px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
}
.hero-nav .hero-next,
.hero-nav .hero-prev {
  width: 42px;
  height: 42px;
  border-radius: 10px; /* rounded square look */
  background: rgba(40,40,44,0.6);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background .18s, transform .18s, border-color .18s, box-shadow .18s;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}
.hero-nav .hero-next:hover, .hero-nav .hero-next:focus-visible,
.hero-nav .hero-prev:hover, .hero-nav .hero-prev:focus-visible {
  background: rgba(40,40,44,0.8);
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.28);
}

/* Swipe/slide transition */
.home-hero.hero-transition-in .home-hero-bg { animation: heroSlideIn 0.28s ease both; }
.home-hero.hero-transition-out .home-hero-bg { animation: heroSlideOut 0.14s ease both; }
.home-hero.hero-transition-in .home-hero-content { animation: heroContentIn 0.32s ease both; }
.home-hero.hero-transition-out .home-hero-content { animation: heroContentOut 0.14s ease both; }

/* New direction-aware animations for better feel */
.home-hero.hero-in-next .home-hero-bg { animation: heroInNextBG .36s cubic-bezier(.2,.8,.2,1) both; }
.home-hero.hero-out-next .home-hero-bg { animation: heroOutNextBG .20s ease both; }
.home-hero.hero-in-prev .home-hero-bg { animation: heroInPrevBG .36s cubic-bezier(.2,.8,.2,1) both; }
.home-hero.hero-out-prev .home-hero-bg { animation: heroOutPrevBG .20s ease both; }
.home-hero.hero-in-next .home-hero-content { animation: heroInNextContent .40s cubic-bezier(.2,.8,.2,1) both; }
.home-hero.hero-out-next .home-hero-content { animation: heroOutNextContent .18s ease both; }
.home-hero.hero-in-prev .home-hero-content { animation: heroInPrevContent .40s cubic-bezier(.2,.8,.2,1) both; }
.home-hero.hero-out-prev .home-hero-content { animation: heroOutPrevContent .18s ease both; }

@keyframes heroSlideIn {
  0% { transform: translateX(6%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes heroSlideOut {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(-6%); opacity: 0.7; }
}
@keyframes heroContentIn {
  0% { transform: translateY(6px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes heroContentOut {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-4px); opacity: 0; }
}

/* Direction-aware BG animations */
@keyframes heroInNextBG { from { transform: translateX(4%); filter: brightness(.9); opacity: .85; } to { transform: translateX(0); filter: none; opacity: 1; } }
@keyframes heroOutNextBG { from { transform: translateX(0); opacity: 1; } to { transform: translateX(-3%); opacity: .6; } }
@keyframes heroInPrevBG { from { transform: translateX(-4%); filter: brightness(.9); opacity: .85; } to { transform: translateX(0); filter: none; opacity: 1; } }
@keyframes heroOutPrevBG { from { transform: translateX(0); opacity: 1; } to { transform: translateX(3%); opacity: .6; } }

/* Direction-aware content animations (slightly different easing) */
@keyframes heroInNextContent { from { transform: translate(10px, 6px); opacity: 0; } to { transform: translate(0,0); opacity: 1; } }
@keyframes heroOutNextContent { from { transform: translate(0,0); opacity: 1; } to { transform: translate(-8px, -4px); opacity: 0; } }
@keyframes heroInPrevContent { from { transform: translate(-10px, 6px); opacity: 0; } to { transform: translate(0,0); opacity: 1; } }
@keyframes heroOutPrevContent { from { transform: translate(0,0); opacity: 1; } to { transform: translate(8px, -4px); opacity: 0; } }

/* Click feedback on chevrons */
.hero-nav .hero-prev:active, .hero-nav .hero-next:active {
  transform: translateY(-1px) scale(0.96);
  box-shadow: 0 1px 6px rgba(0,0,0,0.2);
}

@media (max-width: 720px) {
  .home-hero { 
    min-height: 300px; 
    width: min(92vw, calc(100% - 24px));
    margin-left: auto; 
    margin-right: auto; 
    margin-top: 10px; 
    margin-bottom: 10px; 
    border-radius: 16px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.16);
  }
  .home-hero-content { 
    position: absolute; 
    left: 0; right: 0; bottom: 0; 
    padding: 20px 16px 18px; 
    max-width: 100%; 
  }
  /* Slightly zoom out feel by centering subject */
  .home-hero-bg { background-position: center center; }
  /* Lighten overlay a touch on phones */
  .home-hero-shade {
    background:
      radial-gradient(60% 70% at 85% 50%, rgba(0,0,0,0.00) 0%, rgba(0,0,0,0.18) 58%, rgba(0,0,0,0.24) 100%),
      linear-gradient(90deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.32) 28%, rgba(0,0,0,0.18) 52%, rgba(0,0,0,0.35) 86%),
      linear-gradient(180deg, rgba(0,0,0,0.00) 0%, rgba(0,0,0,0.45) 100%);
  }
  .hero-title { margin: 4px 0 6px; }
  .hero-desc { display: none !important; }
  /* Vertical dots on right side */
  .hero-dots {
    left: auto;
    right: 10px;
    bottom: 50%;
    transform: translateY(50%);
    flex-direction: column;
    gap: 10px;
  }
  .hero-dots .dot { width: 10px; height: 10px; border-width: 2px; }
  /* Hide chevrons on phones */
  .hero-nav { display: none; }
  /* Pill buttons and tighter layout */
  .hero-actions { gap: 8px; }
  .btn.primary.hero-watch { border-radius: 999px; padding: 12px 18px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
  .btn.primary.hero-watch::before {
    content: '▶';
    font-size: 0.9em;
    margin-right: 8px;
    line-height: 1;
    display: inline-block;
    transform: translateY(1px);
  }
}

/* Light mode adjustments for hero */
@media (prefers-color-scheme: light) {
  .home-hero { background: #f5f5f5; }
  .home-hero-shade {
    background:
      radial-gradient(60% 70% at 85% 50%, rgba(255,255,255,0.00) 0%, rgba(0,0,0,0.22) 58%, rgba(0,0,0,0.30) 100%),
      linear-gradient(90deg, rgba(255,255,255,0.65) 0%, rgba(255,255,255,0.35) 30%, rgba(255,255,255,0.10) 55%, rgba(0,0,0,0.20) 88%),
      linear-gradient(180deg, rgba(255,255,255,0.00) 0%, rgba(0,0,0,0.22) 100%);
  }
  .btn.text.hero-detail { background: rgba(255,255,255,0.85); border-color: #d8d8d8; color: #333; }
}

/* Force spotlight text white */
.home-hero .hero-eyebrow,
.home-hero .hero-title,
.home-hero .hero-desc { color: #fff !important; }

/* ===== Generic vertical card grid (used by search results) ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  max-width: 1200px;
  margin: 8px auto 32px;
  padding: 0 8px;
  box-sizing: border-box;
}
@media (max-width: 1200px) { .card-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 992px)  { .card-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 768px)  { .card-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
@media (max-width: 560px)  { .card-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
@media (max-width: 380px)  { .card-grid { grid-template-columns: 1fr; gap: 10px; } }

/* Ensure cards behave responsively inside grids (override horizontal scroller widths) */
.card-grid .show-card { width: 100% !important; min-width: 0; }
.card-grid .show-card img { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; }

/* ===== Shared pager styles ===== */
.pager { max-width: 1200px; margin: 10px auto 44px; padding: 0 8px; display: flex; justify-content: center; gap: 10px; box-sizing: border-box; max-width: 100%; overflow-x: auto; }
.pager-inner { display: flex; gap: 10px; }
.page-btn { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--input-border); background: #2c2c2e; color: #a9b3c1; cursor: pointer; user-select: none; transition: background .18s ease, transform .12s ease; }
.page-btn:hover { background: #343437; transform: translateY(-1px); }
.page-btn.current { background: #ffe08a; color: #111; font-weight: 800; }
.page-btn[disabled] { opacity: .5; cursor: default; }
@media (max-width: 560px) { .page-btn { width: 34px; height: 34px; } }
@media (max-width: 380px) { .page-btn { width: 32px; height: 32px; } }

/* === Announcement Bar === */
.announcement-bar {
  width: 100%;
  background: #0b0b0b;
  color: #eee;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.4;
  padding: 8px 12px;
  text-align: center;
  position: relative; /* stay in normal flow to avoid overlap */
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.announcement-bar .cta { color: #ffd400; text-decoration: none; font-weight: 800; }
.announcement-bar .cta:hover {
  color: #ffea70;
}

/* Responsive sizing for banner text on phones */
@media (max-width: 600px) {
  .announcement-bar {
    font-size: 15px;
    padding: 6px 10px;
  }
}
@media (max-width: 420px) {
  .announcement-bar {
    font-size: 14px;
    padding: 6px 8px;
  }
}
