/* Movie Cosmos — Variant design system (cosmos-design.css) v1.1.9 — fonts linked from _Layout.cshtml */

:root {
  --bg-base: #030407;
  --bg-surface: #0a0c13;
  --bg-surface-hover: #121520;
  --bg-nav: rgba(3, 4, 7, 0.85);

  --accent-primary: #2d5af0;
  --accent-glow: rgba(45, 90, 240, 0.15);
  --accent-glow-strong: rgba(45, 90, 240, 0.3);

  --text-primary: #ffffff;
  --text-secondary: #8a93a6;
  /* Was #52596d; nudge lighter (~same intent as easing off #444444-class grays) */
  --text-tertiary: #5c6478;
  /* Section / search h2: between primary and secondary (reference: new_design section titles) */
  --text-section-heading: #c8cedd;
  /* Actor search / detail body copy (lighter than --text-secondary for readability on dark bg) */
  --text-actor-readable: #b4bcc8;
  --text-actor-label: #d8dce6;

  --border-subtle: rgba(255, 255, 255, 0.06);
  /* hr / section dividers — blue-gray, visible on dark bg (ties to accent hue) */
  --border-hr: rgba(95, 115, 175, 0.45);
  --star-color: #ffd700;

  /* Wordmark: cream “Movie” + blue “Cosmos” (reference brand image) */
  --logo-movie-text: #f5f0e6;
  --logo-cosmos-blue: #4a90e2;

  --font-serif: "Playfair Display", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;

  --radius-lg: 16px;
  --radius-md: 8px;
  --radius-sm: 4px;
  --radius-pill: 99px;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-xxl: 80px;

  --container-width: 1400px;
}

body.cosmos-theme {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  background-image: radial-gradient(circle at 50% 0%, var(--accent-glow) 0%, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  padding-bottom: 0;
}

body.cosmos-theme a {
  color: inherit;
  text-decoration: none;
}

body.cosmos-theme h1,
body.cosmos-theme h2,
body.cosmos-theme h3,
body.cosmos-theme .serif-text {
  font-family: var(--font-serif);
  font-weight: 400;
}

body.cosmos-theme .text-micro {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

body.cosmos-theme main.site-main {
  /* Offset for fixed header */
  padding-top: 112px;
}

body.cosmos-theme .body-content-wrap {
  min-height: 50vh;
  /* No horizontal padding: inner .container must center in the full viewport like header.top-nav .container,
     or the content column shifts left on wide screens vs the logo. */
}

/* Match header: same max-width and horizontal padding so logo and section titles share one column edge */
body.cosmos-theme main.site-main .container {
  max-width: var(--container-width);
  width: 100%;
  padding-left: var(--space-xl);
  padding-right: var(--space-xl);
}

body.cosmos-theme .site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-lg) var(--space-xl);
  color: var(--text-tertiary);
  font-size: 13px;
  text-align: center;
}

body.cosmos-theme .flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

body.cosmos-theme .top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  min-height: 0;
  padding-top: 10px;
  padding-bottom: 12px;
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  display: flex;
  align-items: center;
}

body.cosmos-theme .nav-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  width: 100%;
  align-items: center;
  gap: var(--space-md);
}

/* Same as hero-grid: Bootstrap .container clearfix ::before/::after become grid items and break columns */
body.cosmos-theme header.top-nav .nav-inner.container::before,
body.cosmos-theme header.top-nav .nav-inner.container::after {
  content: none;
  display: none;
}

body.cosmos-theme .nav-search-column {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: 0;
  justify-self: end;
  width: 100%;
  max-width: 100%;
}

body.cosmos-theme header.top-nav .container {
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
  margin-top: 0;
  margin-bottom: 0;
  padding-left: var(--space-xl);
  padding-right: var(--space-xl);
}

body.cosmos-theme .logo {
  font-family: var(--font-serif);
  font-size: clamp(26px, 2.4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--logo-movie-text);
  white-space: nowrap;
  justify-self: start;
  line-height: 1.15;
  text-decoration: none;
}

body.cosmos-theme .logo .logo-movie {
  color: var(--logo-movie-text);
}

body.cosmos-theme .logo .logo-cosmos {
  color: var(--logo-cosmos-blue);
}

body.cosmos-theme .logo:hover .logo-movie,
body.cosmos-theme .logo:focus-visible .logo-movie {
  color: #fffef8;
}

body.cosmos-theme .logo:hover .logo-cosmos,
body.cosmos-theme .logo:focus-visible .logo-cosmos {
  color: #6ba8f0;
}

body.cosmos-theme form.search-container {
  margin: 0;
}

body.cosmos-theme .search-container {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 4px 5px 4px 14px;
  width: 100%;
  max-width: 320px;
  transition: border-color 0.2s, box-shadow 0.2s;
  align-self: flex-end;
}

body.cosmos-theme .search-container:focus-within {
  border-color: rgba(45, 90, 240, 0.5);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

body.cosmos-theme .search-container .search-input,
body.cosmos-theme .search-container input[type="text"] {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.2;
  width: 100%;
  outline: none;
  max-width: none !important;
  height: auto !important;
  min-height: 30px;
  box-shadow: none;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
}

body.cosmos-theme .search-container .search-input::placeholder {
  color: var(--text-tertiary);
}

body.cosmos-theme .search-btn {
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

body.cosmos-theme .search-btn:hover {
  background: #1c45d8;
  color: white;
}

body.cosmos-theme .nav-links {
  display: flex;
  gap: clamp(10px, 1.5vw, var(--space-lg));
  justify-content: flex-end;
  flex-wrap: nowrap;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

body.cosmos-theme .nav-links a {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
  padding: 8px 2px 8px;
  margin-bottom: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

body.cosmos-theme .nav-links a:hover,
body.cosmos-theme .nav-links a:focus {
  color: var(--text-primary);
}

body.cosmos-theme .nav-links a.active {
  color: var(--text-primary);
}

body.cosmos-theme .site-main .hero {
  margin-top: 0;
  padding: var(--space-xxl) 0;
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
  min-height: 540px;
  /* Override site.css .hero { height: 48vh; overflow: hidden; background: #000 } */
  height: auto;
  overflow: visible;
  background: transparent;
}

body.cosmos-theme .hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0.15;
  mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
  z-index: 0;
}

body.cosmos-theme .hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(3, 4, 7, 0.85) 0%, rgba(3, 4, 7, 0.55) 45%, rgba(3, 4, 7, 0.8) 100%);
}

body.cosmos-theme .hero .container {
  position: relative;
  z-index: 1;
}

/* Bootstrap .container clearfix uses ::before/::after; as grid items they steal columns and stack content under the poster */
body.cosmos-theme .hero .container.hero-grid::before,
body.cosmos-theme .hero .container.hero-grid::after {
  content: none;
  display: none;
}

body.cosmos-theme .hero-grid {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: var(--space-xl);
  align-items: start;
  position: relative;
}

/* Full-area link to detail#desc; tabs & cast sit above via pointer-events */
body.cosmos-theme .hero-primary-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  text-decoration: none;
}

body.cosmos-theme .hero-primary-link:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 4px;
}

body.cosmos-theme .hero-content .hero-interactive {
  pointer-events: auto;
  position: relative;
  z-index: 2;
}

body.cosmos-theme .hero-poster-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-subtle);
  aspect-ratio: 2/3;
  width: 100%;
  max-width: 340px;
}

body.cosmos-theme .hero-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  box-shadow: none;
}

body.cosmos-theme .hero-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding-bottom: var(--space-md);
  min-width: 0;
  width: 100%;
  position: relative;
  z-index: 2;
  pointer-events: none;

}

body.cosmos-theme .hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
  color:white;
}

body.cosmos-theme .hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  color: var(--text-secondary);
  font-size: 14px;
}

body.cosmos-theme .meta-divider {
  width: 4px;
  height: 4px;
  background: var(--text-tertiary);
  border-radius: 50%;
}

body.cosmos-theme .hero-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  margin-top: var(--space-lg);
  padding-bottom: var(--space-md);
}

body.cosmos-theme .hero-tabs .tab {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  padding-bottom: var(--space-sm);
}

body.cosmos-theme .hero-tabs .tab.active {
  color: var(--text-primary);
}

body.cosmos-theme .hero-tabs .tab.active::after {
  content: "";
  position: absolute;
  bottom: -17px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-primary);
  box-shadow: 0 -2px 10px var(--accent-glow-strong);
}

body.cosmos-theme .hero-description {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  max-width: 800px;
  margin-top: var(--space-md);
}

body.cosmos-theme .hero-cast {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-md);
  flex-wrap: wrap;
}

body.cosmos-theme .cast-member {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: rgba(255, 255, 255, 0.03);
  padding: var(--space-xs) var(--space-sm) var(--space-xs) var(--space-xs);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, border-color 0.15s;
}

body.cosmos-theme .hero-cast .cast-member:hover,
body.cosmos-theme .hero-cast .cast-member:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  outline: none;
}

body.cosmos-theme .cast-img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

body.cosmos-theme .cast-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  background: rgba(45, 90, 240, 0.2);
  color: #dce6ff;
  flex-shrink: 0;
}

body.cosmos-theme .cast-name {
  font-size: 12px;
  color: var(--text-secondary);
}

body.cosmos-theme .section {
  padding: var(--space-xl) 0;
}

body.cosmos-theme .section-header {
  margin-bottom: var(--space-lg);
}

body.cosmos-theme .section-title {
  font-size: 32px;
  letter-spacing: -0.01em;
  margin: 0;
  color:white;
}

body.cosmos-theme .show-all {
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
  color: var(--text-secondary);
}

body.cosmos-theme .show-all:hover {
  color: var(--text-primary);
}

body.cosmos-theme .show-all svg {
  width: 16px;
  height: 16px;
  position: static;
  display: block;
  background: none;
}

body.cosmos-theme .movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-lg);
}

body.cosmos-theme .movie-grid .list-item {
  width: auto !important;
  padding: 0 !important;
  display: flex;
}

body.cosmos-theme .movie-shelf {
  display: flex;
  gap: var(--space-lg);
  overflow-x: auto;
  padding-bottom: var(--space-md);
  scrollbar-width: none;
}

body.cosmos-theme .movie-shelf::-webkit-scrollbar {
  display: none;
}

body.cosmos-theme .movie-shelf .movie-card {
  flex: 0 0 220px;
}

body.cosmos-theme .movie-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Poster link: remove tap/click flash without changing layout */
body.cosmos-theme .movie-card > a:first-child {
  -webkit-tap-highlight-color: transparent;
}

body.cosmos-theme .movie-card > a:first-child:focus {
  outline: none;
}

body.cosmos-theme .movie-card > a:first-child:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

body.cosmos-theme .card-poster-container {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

body.cosmos-theme .card-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  backface-visibility: hidden;
  transition: transform 0.5s ease;
  box-shadow: none;
}

body.cosmos-theme .movie-card:hover .card-poster-container {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1), 0 4px 20px var(--accent-glow);
}

body.cosmos-theme .movie-card:hover .card-poster {
  transform: scale(1.05);
}

body.cosmos-theme .ribbon,
body.cosmos-theme .not-released-ribbon {
  position: absolute;
  top: 8px;
  right: 8px;
  left: auto;
  width: auto;
  background: var(--accent-primary);
  color: white;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.05em;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  z-index: 2;
  transform: none;
  transform-origin: initial;
}

body.cosmos-theme .card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

body.cosmos-theme .card-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-sans);
  margin: 0;
}

body.cosmos-theme .card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

body.cosmos-theme .rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

body.cosmos-theme .rating svg {
  width: 14px;
  height: 14px;
  fill: var(--star-color);
  position: static !important;
  display: block;
  background: none;
}

body.cosmos-theme .release-date {
  font-size: 13px;
  color: var(--text-tertiary);
}

body.cosmos-theme .genres {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

body.cosmos-theme .genre-tag {
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

body.cosmos-theme .detail-page .airdc-check-pill {
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  margin-left: 6px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  vertical-align: middle;
}

body.cosmos-theme .detail-page .airdc-check-pill:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

body.cosmos-theme .detail-page .airdc-check-pill:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

body.cosmos-theme .detail-page .airdc-status {
  display: inline-block;
  font-size: 11px;
  line-height: 1.3;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  vertical-align: middle;
}

body.cosmos-theme .detail-page .airdc-status--pending {
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.05);
}

body.cosmos-theme .detail-page .airdc-status--found {
  color: var(--text-secondary);
  background: rgba(120, 200, 180, 0.14);
}

body.cosmos-theme .detail-page .airdc-status--notfound {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
}

/* --- Overrides for legacy site.css / Bootstrap --- */

body.cosmos-theme svg {
  position: static !important;
  background: none !important;
  background-image: none !important;
}

body.cosmos-theme .score-indicator svg,
body.cosmos-theme .poster-container canvas {
  position: static;
}

body.cosmos-theme .poster-container .score-indicator {
  position: absolute;
  top: 7px;
  left: 6px;
}

/* Detail page main poster: match list cards (radius + frame) */
body.cosmos-theme .detail-page .poster-container {
  display: inline-block;
  border-radius: var(--radius-md);
}

body.cosmos-theme .detail-page .poster-container > img {
  display: block;
  border-radius: inherit;
}

body.cosmos-theme img {
  box-shadow: none;
}

body.cosmos-theme .card-poster-container img,
body.cosmos-theme .hero-poster,
body.cosmos-theme .video-content iframe,
body.cosmos-theme .fitvids {
  box-shadow: none;
}

body.cosmos-theme .video-content {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

body.cosmos-theme .gallery-page h1 {
  font-family: var(--font-serif);
  font-size: 32px;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
}

body.cosmos-theme .filter-toggle-link {
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  margin-bottom: var(--space-md);
  display: inline-block;
}

body.cosmos-theme .filter-toggle-link:hover {
  color: var(--text-primary);
}

body.cosmos-theme #genre-filter-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

body.cosmos-theme .genre-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 10px 6px 0;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}

body.cosmos-theme .genre-checkbox-label input[type="checkbox"]:checked {
  accent-color: var(--accent-primary);
}

body.cosmos-theme .btn-load-more,
body.cosmos-theme .btn-cosmos-blue {
  background: var(--accent-primary) !important;
  background-image: none !important;
  border: none;
  border-radius: var(--radius-pill);
  color: white !important;
  font-weight: 500;
  padding: 12px 24px;
  width: 100%;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  display: block;
}

body.cosmos-theme .btn-load-more {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-lg);
}

body.cosmos-theme .btn-cosmos-blue:hover {
  filter: brightness(1.08);
}

body.cosmos-theme .detail-page {
  color: var(--text-primary);
}

body.cosmos-theme .detail-page .well {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  padding: var(--space-lg);
}

body.cosmos-theme .detail-page .well h3,
body.cosmos-theme .detail-page .well h4 {
  color: var(--text-primary);
  font-family: var(--font-serif);
}

body.cosmos-theme .detail-page .nav-tabs {
  border-bottom: 1px solid var(--border-subtle);
}

body.cosmos-theme .detail-page .nav-tabs > li > a {
  color: var(--text-secondary);
  border: none !important;
  background: transparent !important;
  font-weight: 500;
}

body.cosmos-theme .detail-page .nav-tabs > li.active > a,
body.cosmos-theme .detail-page .nav-tabs > li > a:hover {
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent-primary) !important;
}

body.cosmos-theme .detail-page .image-poster-container h1 {
  font-family: var(--font-serif);
  color: var(--text-primary);
}

body.cosmos-theme .detail-page h5,
body.cosmos-theme .detail-page label {
  color: var(--text-secondary);
}

body.cosmos-theme .detail-page a {
  color: var(--accent-primary);
}

body.cosmos-theme .detail-page .rating-help-tooltip {
  position: relative;
  display: inline-block;
  border-bottom: 1px dotted rgba(135, 179, 255, 0.55);
  cursor: help;
}

body.cosmos-theme .detail-page .rating-help-tooltip::after {
  content: attr(data-rating-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translateX(-50%) translateY(4px);
  width: min(280px, 75vw);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(74, 144, 226, 0.55);
  background: rgba(7, 12, 20, 0.96);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  color: var(--text-primary);
  font-size: 0.88em;
  line-height: 1.35;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  z-index: 10;
}

body.cosmos-theme .detail-page .rating-help-tooltip::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(74, 144, 226, 0.55);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.16s ease, visibility 0.16s ease;
  z-index: 10;
}

body.cosmos-theme .detail-page .rating-help-tooltip:hover::after,
body.cosmos-theme .detail-page .rating-help-tooltip:hover::before,
body.cosmos-theme .detail-page .rating-help-tooltip:focus-visible::after,
body.cosmos-theme .detail-page .rating-help-tooltip:focus-visible::before {
  opacity: 1;
  visibility: visible;
}

body.cosmos-theme .detail-page .rating-help-tooltip:hover::after,
body.cosmos-theme .detail-page .rating-help-tooltip:focus-visible::after {
  transform: translateX(-50%) translateY(0);
}

body.cosmos-theme .detail-page p.cast-role {
  color: var(--text-tertiary) !important;
  font-weight: 600;
}

body.cosmos-theme .detail-page .tab-content,
body.cosmos-theme .detail-page .tab-content div,
body.cosmos-theme .detail-page .tab-content p,
body.cosmos-theme .detail-page .tab-content li,
body.cosmos-theme .detail-page .tab-content small {
  color: var(--text-actor-readable);
}

body.cosmos-theme .detail-page .flex2-container .image-padding img {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

body.cosmos-theme .actor-results-page {
  color: var(--text-actor-readable);
}

body.cosmos-theme .actor-results-page h1,
body.cosmos-theme .actor-results-page h2,
body.cosmos-theme .actor-results-page h3,
body.cosmos-theme .actor-results-page h4 {
  color: var(--text-primary);
}

body.cosmos-theme .actor-result-body {
  color: var(--text-actor-readable);
}

body.cosmos-theme .actor-result-body h5 {
  color: var(--text-section-heading);
  font-weight: 500;
}

body.cosmos-theme .actor-result-body h5 label {
  color: var(--text-actor-label);
  font-weight: 500;
}

body.cosmos-theme .actor-result-body p {
  color: var(--text-actor-readable);
}

body.cosmos-theme .actor-results-page .actor-picture img {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  width: 100%;
  max-width: 185px;
}

/* Known-for + filmography: same corner radius as .card-poster-container on home (knownfor uses .knownfor-poster; AJAX filmography uses .media-object only) */
body.cosmos-theme .actor-results-page .media-left .media-object {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

body.cosmos-theme .actor-results-page .knownfor-description {
  color: var(--text-actor-readable);
}

body.cosmos-theme .actor-results-page .photo-thumbnail {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

body.cosmos-theme .actor-results-page .photo-thumbnail.more-photos {
  background: var(--accent-primary);
  color: #fff;
}

body.cosmos-theme .actor-results-page .highlight {
  color: #dce6ff;
}

body.cosmos-theme .movie-results-page {
  color: var(--text-secondary);
}

body.cosmos-theme .movie-results-page h1,
body.cosmos-theme .movie-results-page h2,
body.cosmos-theme .movie-results-page h3,
body.cosmos-theme .movie-results-page h4 {
  color: var(--text-primary);
}

body.cosmos-theme .movie-results-page .well {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  padding: var(--space-lg);
}

body.cosmos-theme .movie-results-page .poster {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  width: 100%;
  max-width: 240px;
}

/* Universal search wraps partials in .search-results-page; keep poster/cast thumbs aligned with home cards */
body.cosmos-theme .search-results-page .poster {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

body.cosmos-theme .search-results-page .actor-picture img {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  width: 100%;
  max-width: 185px;
}

body.cosmos-theme .search-results-page .media-left .media-object {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

body.cosmos-theme .movie-results-page .row-space {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: var(--space-lg);
  margin-bottom: var(--space-lg);
}

/* Nested BS3 .row uses -15px gutters; inside .col-md-12 that pulls poster row left of full-width h2 — align with headings */
body.cosmos-theme .movie-results-page .row.row-space {
  margin-left: 0;
  margin-right: 0;
}

body.cosmos-theme .movie-results-page .row.row-space > .col-md-3:first-child {
  padding-left: 0;
}

body.cosmos-theme .actor-results-page .actor-result-body > .row {
  margin-left: 0;
  margin-right: 0;
}

body.cosmos-theme .actor-results-page .actor-result-body > .row > .col-md-3:first-child {
  padding-left: 0;
}

body.cosmos-theme .search-results-page h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  letter-spacing: -0.01em;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  color: var(--text-section-heading);
  font-weight: 400;
}

body.cosmos-theme .search-results-page h2:first-child {
  margin-top: 0;
}

body.cosmos-theme .search-results-page hr,
body.cosmos-theme .actor-results-page hr {
  border: 0;
  border-top: 1px solid var(--border-hr);
  height: 0;
  margin: var(--space-lg) 0;
  opacity: 1;
}

body.cosmos-theme .cosmos-color {
  background: var(--accent-primary);
  color: white;
}

@media (max-width: 700px) {
  body.cosmos-theme .nav-inner {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  body.cosmos-theme .nav-search-column {
    align-items: stretch;
    max-width: none;
  }

  body.cosmos-theme .nav-search-column .search-container {
    align-self: stretch;
    max-width: none;
  }

  body.cosmos-theme .nav-links {
    justify-content: flex-start;
  }

  body.cosmos-theme .search-container {
    max-width: none;
  }

  body.cosmos-theme .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  body.cosmos-theme .hero-poster-wrapper {
    max-width: 280px;
    margin: 0 auto;
  }

  body.cosmos-theme .site-main .hero {
    min-height: 0;
    padding: var(--space-xl) 0;
  }
}
