/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* PASTEL BLUE LIGHT THEME (DEFAULT) */
  --bg-deep: #f0f7ff;
  /* Very light pastel blue */
  --bg-ambient-gradient: linear-gradient(135deg, #f0f7ff 0%, #e3f2fd 100%);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 122, 255, 0.08);
  /* Subtle blue border */
  --glass-hover: rgba(0, 0, 0, 0.03);
  --text-primary: #2d2d32;
  --text-secondary: #5a5a64;
  --text-muted: #9a9aa5;
  --accent: #7c4dff;
  /* Softer purple */
  --accent2: #448aff;
  /* Softer blue */
  --imdb-yellow: #f5c518;
  --rt-red: #ff5252;
  --rt-green: #4caf50;
  --popcorn-gold: #ffab40;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.dark-theme {
  /* DEEP PASTEL DARK THEME */
  --bg-deep: #1a1a24;
  /* Deep slate pastel */
  --bg-ambient-gradient: linear-gradient(135deg, #1a1a24 0%, #12121a 100%);
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-hover: rgba(255, 255, 255, 0.08);
  --text-primary: #e0e0e8;
  --text-secondary: rgba(224, 224, 232, 0.6);
  --text-muted: rgba(224, 224, 232, 0.35);
  --accent: #b39ddb;
  /* Pastel purple */
  --accent2: #90caf9;
  /* Pastel blue */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.4);
}

html,
body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  overflow: hidden;
}

/* ===== AMBIENT BACKGROUND ===== */
.bg-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--bg-ambient-gradient);
}

/* ===== APP SHELL ===== */
.app-shell {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  max-height: 100vh;
  margin: 0 auto;
  background: var(--bg-deep);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
  transition: background 0.3s ease;
}

.app-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(124, 77, 255, 0.35);
}

@media (min-width: 520px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  .app-shell {
    height: calc(100vh - 40px);
    max-height: 900px;
    border-radius: 28px;
  }
}

/* ===== STATUS BAR ===== */
.status-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 28px 8px;
  z-index: 50;
}

.status-time {
  font-size: 15px;
  font-weight: 600;
  color: white;
  letter-spacing: -0.3px;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== APP HEADER ===== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 8px;
  flex-shrink: 0;
}

.app-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.6px;
  background: linear-gradient(135deg, #7c4dff, #448aff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  cursor: pointer;
  user-select: none;
}

.app-icon {
  font-size: 24px;
  -webkit-text-fill-color: initial;
}

.settings-btn {
  width: 36px;
  height: 36px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.settings-btn:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

/* ===== SEARCH ===== */
/* ===== SEARCH SECTION ===== */
.search-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-mode-toggle {
  display: flex;
  background: var(--glass-bg);
  padding: 3px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}

.mode-label {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s;
  border-radius: 9px;
  z-index: 1;
}

.mode-label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-label span {
  position: relative;
  z-index: 2;
}

.mode-label:has(input:checked) {
  color: var(--text-primary);
  background: var(--glass-bg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.search-container {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  flex-shrink: 0;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 0 12px;
  height: 48px;
  gap: 10px;
  transition: all 0.3s;
  box-shadow: var(--shadow-sm);
}

.search-bar:focus-within {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(167, 139, 250, 0.5);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.1);
}

.search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  outline: none;
  font-family: 'Inter', sans-serif;
  padding: 11px 0;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: 50%;
  transition: color 0.2s;
}

.search-clear:hover {
  color: var(--text-secondary);
}

.search-submit {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  border: none;
  border-radius: 14px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
  flex-shrink: 0;
}

.search-submit:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.5);
}

.search-submit:active {
  transform: scale(0.97);
}

/* ===== CONTENT AREA ===== */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 20px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  will-change: scroll-position;
  transform: translateZ(0);
}

.content-area::-webkit-scrollbar {
  display: none;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  padding: 40px 20px;
  text-align: center;
}

.empty-icon {
  font-size: 56px;
  margin-bottom: 8px;
  opacity: 0.6;
}

.empty-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-sub {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 220px;
}

/* ===== LOADING ===== */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  gap: 16px;
  color: var(--text-secondary);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(167, 139, 250, 0.2);
  border-top-color: #a78bfa;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== ERROR ===== */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  gap: 12px;
  text-align: center;
}

.error-icon {
  font-size: 40px;
}

.error-state p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ===== SEARCH RESULTS LIST ===== */
.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 20px;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.search-result-item {
  display: flex;
  gap: 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s;
  will-change: transform;
}

.search-result-item:hover {
  transform: translateY(-2px);
  border-color: rgba(167, 139, 250, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.search-result-item:active {
  transform: scale(0.98);
}

.result-item-poster {
  width: 60px;
  height: 90px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
}

.result-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.result-item-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.result-item-year {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== ACTOR PROFILE ===== */
.actor-profile {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.actor-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.actor-big-poster {
  width: 100px;
  height: 150px;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

.actor-meta-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.actor-name-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0;
}

.actor-alt-names {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.actor-bio {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: max-height 0.3s;
}

.actor-bio.expanded {
  display: block;
  overflow: visible;
}

.filmography-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.film-item {
  display: flex;
  gap: 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s;
  align-items: center;
}

.film-item:hover {
  background: var(--glass-hover);
  transform: translateX(4px);
}

.film-poster {
  width: 50px;
  height: 75px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.film-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.film-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.2;
}

.film-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ===== RESULT CARD ===== */
.result-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.back-link {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  margin-bottom: 8px;
  transition: opacity 0.2s;
  width: fit-content;
}

.back-link:hover {
  opacity: 0.8;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== MOVIE HEADER ===== */
.movie-header {
  display: flex;
  gap: 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 14px;
}

.movie-poster {
  width: 90px;
  height: 134px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  background: rgba(255, 255, 255, 0.05);
}

.movie-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.movie-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.movie-original {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.3;
}

.movie-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.meta-badge {
  font-size: 11px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 2px 7px;
  color: var(--text-secondary);
}

/* ===== POSTER PLACEHOLDER CSS ===== */
.poster-placeholder-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}

.poster-placeholder-icon {
  font-size: 32px;
  opacity: 0.2;
  color: var(--text-primary);
}

.movie-genre {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.genre-tag {
  font-size: 10px;
  font-weight: 500;
  background: rgba(167, 139, 250, 0.15);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 5px;
  padding: 2px 6px;
  color: #c4b5fd;
}

/* ===== SCORE ROW ===== */
.score-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.imdb-card {
  border-color: rgba(245, 197, 24, 0.2);
  background: rgba(245, 197, 24, 0.05);
}

.imdb-logo {
  background: var(--imdb-yellow);
  color: #000;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.score-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--imdb-yellow);
  letter-spacing: -0.5px;
}

.score-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== TV SEASONS ===== */
.tv-seasons-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-top: 8px;
}

.tv-summary-line {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.2px;
}

.season-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.season-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.season-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.season-episodes {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 6px;
}

.score-votes {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: auto;
}

.cast-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.2), rgba(96, 165, 250, 0.15));
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: var(--radius-md);
  color: #c4b5fd;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.cast-btn:hover {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.3), rgba(96, 165, 250, 0.25));
  transform: scale(1.02);
}

.cast-btn:active {
  transform: scale(0.98);
}

/* ===== SECTION TITLE ===== */
.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
  margin-top: 4px;
}

/* ===== ROTTEN TOMATOES MINIMAL ===== */
.rt-minimal-row {
  display: flex;
  gap: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 10px 16px;
  margin-top: 8px;
  width: fit-content;
}

.rt-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rt-icon {
  font-size: 18px;
}

.rt-score {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.rt-item.fresh .rt-score {
  color: var(--rt-green);
}

.rt-item.rotten .rt-score {
  color: var(--rt-red);
}

.rt-item.popcorn-hot .rt-score {
  color: var(--popcorn-gold);
}

/* ===== ACTOR DATES ===== */
.actor-dates {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 500;
  display: flex;
  gap: 6px;
}

/* ===== HEADER ACTIONS ===== */
.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.theme-toggle,
.settings-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.theme-toggle:hover,
.settings-btn:hover {
  background: var(--glass-hover);
  transform: scale(1.05);
}

.theme-toggle:active,
.settings-btn:active {
  transform: scale(0.95);
}

/* ===== IMDB DEEP LINK BTN ===== */
.imdb-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f5c518;
  color: #000;
  padding: 6px 12px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
  transition: transform 0.2s ease;
  width: fit-content;
}

.imdb-link-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.imdb-link-btn:active {
  transform: translateY(0);
}

/* ===== PLATFORMS ===== */
.platforms-area {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.platforms-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.mini-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(167, 139, 250, 0.2);
  border-top-color: #a78bfa;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.platforms-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.platform-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.platform-badge:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.platform-logo {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
}

.platform-type {
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 1px 4px;
}

.platforms-none {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* ===== PLOT ===== */
.plot-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px;
}

/* ===== CREDITS ===== */
.credits-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.credit-item {
  display: flex;
  gap: 8px;
  font-size: 12px;
}

.credit-label {
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
  min-width: 60px;
}

.credit-value {
  color: var(--text-secondary);
}

/* ===== HOME INDICATOR ===== */
.home-indicator {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.home-indicator::after {
  content: '';
  width: 134px;
  height: 5px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
  will-change: opacity;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-sheet {
  width: 100%;
  max-width: 393px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-bottom: none;
  border-radius: 28px 28px 0 0;
  padding: 0 0 40px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: slideSheet 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: var(--text-primary);
}

@keyframes slideSheet {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
}

/* ===== CAST LIST ===== */
.cast-list {
  overflow-y: auto;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  will-change: scroll-position;
  transform: translateZ(0);
}

.cast-list::-webkit-scrollbar {
  display: none;
}

.cast-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.cast-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.cast-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}

.cast-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cast-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.cast-role {
  font-size: 12px;
  color: #a78bfa;
  font-weight: 500;
  margin-top: 1px;
}

.cast-number {
  display: none;
}

/* ===== SETTINGS ===== */
.settings-sheet {
  max-height: 70vh;
}

.settings-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.required {
  color: #f87171;
}

.field-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.field-hint a {
  color: #a78bfa;
  text-decoration: none;
}

.field-hint a:hover {
  text-decoration: underline;
}

.settings-field input {
  background: var(--bg-deep);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 11px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: all 0.2s;
}

.settings-field input:focus {
  border-color: rgba(167, 139, 250, 0.5);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.1);
}

.settings-field input::placeholder {
  color: var(--text-muted);
}

.save-btn {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  border: none;
  border-radius: 14px;
  color: white;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  padding: 13px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.save-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.5);
}

.save-btn:active {
  transform: scale(0.98);
}

.settings-note {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* ===== ATTRIBUTION ===== */
.tmdb-inline-logo {
  height: 10px;
  opacity: 0.5;
  margin-left: auto;
  filter: brightness(0) invert(1);
}

/* Inline link in section titles */
.attr-inline-link {
  margin-left: auto;
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.2px;
  opacity: 0.7;
  transition: opacity 0.2s, color 0.2s;
}

.attr-inline-link:hover {
  opacity: 1;
  color: var(--accent);
}

/* Footer attribution bar */
.attribution-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.attr-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: nowrap;
}

.attr-logo {
  height: 18px;
  width: auto;
  opacity: 0.8;
  transition: all 0.2s ease;
}

.attr-logo.custom-logo {
  height: 24px;
  border-radius: 4px;
}

.attr-logo-link:hover .attr-logo {
  opacity: 1;
  transform: scale(1.1);
}

.dark-theme .attr-logo {
  opacity: 0.7;
}

.dark-theme .attr-logo.tmdb {
  filter: brightness(0) invert(1);
}

.dark-theme .attr-logo.custom-logo {
  filter: none; /* Keep natural colors for custom logos */
}

.attr-sep {
  color: var(--text-muted);
  font-size: 9px;
  opacity: 0.5;
}

.attr-link {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s, color 0.2s;
}

.attr-link:hover {
  opacity: 1;
  color: var(--accent);
}

.attr-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  opacity: 0.4;
  transition: opacity 0.2s;
}

.attr-logo-link:hover {
  opacity: 0.8;
}

.attr-note {
  font-size: 8px;
  color: var(--text-muted);
  opacity: 0.5;
  text-align: center;
  letter-spacing: 0.1px;
}


/* ===== RESPONSIVE ===== */
@media (max-height: 900px) {
  .iphone-frame {
    height: calc(100vh - 40px);
    border-radius: 44px;
  }

  .dynamic-island {
    top: 10px;
  }
}

@media (max-width: 430px) {
  .iphone-wrapper {
    padding: 0;
  }

  .iphone-frame {
    width: 100%;
    border-radius: 0;
    box-shadow: none;
  }
}
/* ===== RECENT SEARCHES ===== */
.recent-searches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0 4px;
}
.recent-chip {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}
.recent-chip:hover {
  border-color: rgba(167, 139, 250, 0.5);
  color: var(--text-primary);
}

/* ===== FAVORITES HEADER BTN ===== */
.fav-header-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: #f87171;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fav-header-btn:hover { background: rgba(255,255,255,0.08); }

/* ===== FAVORITE BTN ON CARD ===== */
.movie-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.movie-title-row .movie-title { flex: 1; }
.fav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.2s, transform 0.2s;
}
.fav-btn:hover { transform: scale(1.15); }
.fav-btn.fav-active { color: #f87171; }

/* ===== RESULTS HEADER ===== */
.results-header {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  padding: 4px 2px 8px;
}

.external-score-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--accent2);
  text-decoration: none;
}
.external-score-link:hover { text-decoration: underline; }

.external-score-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent2);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}
.external-score-link:hover { text-decoration: none; background: rgba(255,255,255,0.08); }
.fa-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 4px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
}
.history-item {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.history-q { font-weight: 600; color: var(--text-primary); }
.history-date { font-size: 11px; color: var(--text-muted); }
.history-repeat {
  align-self: flex-start;
  background: var(--accent2);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.modal-sheet {
  color: var(--text-primary);
}
.settings-field label {
  color: var(--text-primary);
}
.field-hint {
  color: var(--text-secondary);
}
.settings-note {
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.score-logo-img {
  height: 16px;
  width: auto;
  object-fit: contain;
}
.score-card {
  cursor: default;
}

/* ===== TMDB SCORE ===== */
.tmdb-card {
  border-color: rgba(68, 138, 255, 0.25);
  background: rgba(68, 138, 255, 0.06);
}
.tmdb-card .score-value {
  color: var(--accent2);
}
.tmdb-title-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* ===== SECTION ICON LINK (JustWatch) ===== */
.section-icon-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.section-icon {
  width: 40px;
  height: 20px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 4px;
  transition: transform 0.2s ease;
}
.section-icon-link:hover .section-icon {
  transform: scale(1.1);
}
