/* ============================================
   SEARCH.CSS - Redesigned Search Experience
   Proper light/dark mode, refined UI
   ============================================ */

/* ===== CSS VARIABLES - DARK-FIRST ===== */
.search-page {
  --search-transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  /* Dark mode defaults */
  --s-bg: var(--bg);
  --s-bg-subtle: rgba(255, 255, 255, 0.04);
  --s-bg-elevated: rgba(255, 255, 255, 0.06);
  --s-border: var(--border);
  --s-border-strong: rgba(255, 255, 255, 0.15);
  --s-text: var(--text);
  --s-text-secondary: var(--text-secondary);
  --s-text-muted: var(--text-muted);
  --s-accent: var(--brand-primary);
  --s-accent-bg: rgba(233, 30, 99, 0.10);
  --s-accent-bg-strong: rgba(233, 30, 99, 0.15);
  --s-hover: rgba(255, 255, 255, 0.06);
  --s-active: rgba(233, 30, 99, 0.12);
  --s-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  --s-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);

  /* Sheet specific */
  --sheet-bg: var(--panel-solid, #141414);
  --sheet-handle: rgba(255, 255, 255, 0.2);
  --sheet-item-hover: rgba(255, 255, 255, 0.06);
  --sheet-item-selected: rgba(233, 30, 99, 0.12);
}

/* ===== LIGHT MODE ===== */
@media (prefers-color-scheme: light) {
  .search-page {
    --s-bg: #ffffff;
    --s-bg-subtle: #f5f5f7;
    --s-bg-elevated: #ffffff;
    --s-border: rgba(0, 0, 0, 0.08);
    --s-border-strong: rgba(0, 0, 0, 0.12);
    --s-text: #1d1d1f;
    --s-text-secondary: #6e6e73;
    --s-text-muted: #aeaeb2;
    --s-accent: #E91E63;
    --s-accent-bg: rgba(233, 30, 99, 0.08);
    --s-accent-bg-strong: rgba(233, 30, 99, 0.12);
    --s-hover: rgba(0, 0, 0, 0.04);
    --s-active: rgba(233, 30, 99, 0.10);
    --s-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --s-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);

    --sheet-bg: #ffffff;
    --sheet-handle: rgba(0, 0, 0, 0.15);
    --sheet-item-hover: rgba(0, 0, 0, 0.04);
    --sheet-item-selected: rgba(233, 30, 99, 0.08);
  }
}

/* ===== PAGE HEADER ===== */
.search-header {
  margin-bottom: var(--space-lg);
}

.search-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--s-text);
  margin: 0 0 0.35rem 0;
  letter-spacing: -0.03em;
}

.search-header p {
  color: var(--s-text-secondary);
  font-size: 0.95rem;
  margin: 0;
}

/* ===== DISCOVER ENTRY ===== */
.discover-entry {
  margin: 0 0 var(--space-md);
}

.discover-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--s-border);
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  background:
    radial-gradient(140% 120% at 0% 0%, var(--s-accent-bg) 0%, transparent 55%),
    var(--s-bg-elevated);
  box-shadow: var(--s-shadow);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.discover-link:hover {
  border-color: var(--s-border-strong);
  box-shadow: var(--s-shadow-lg);
  transform: translateY(-1px);
}

.discover-link:active {
  transform: scale(0.99);
}

.discover-copy {
  min-width: 0;
}

.discover-kicker {
  margin: 0 0 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
  color: var(--s-text-secondary);
  font-weight: 700;
}

.discover-copy h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
  font-weight: 800;
  color: var(--s-text);
}

.discover-copy small {
  display: block;
  margin-top: 0.15rem;
  color: var(--s-text-secondary);
  font-size: 0.78rem;
  line-height: 1.35;
}

.discover-arrow {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  border: 1px solid var(--s-border-strong);
  color: var(--s-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

/* ===== SEARCH INPUT CONTAINER ===== */
.search-input-container {
  position: relative;
  margin-bottom: var(--space-md);
}

.search-input-container .search-input {
  width: 100%;
  height: 3.25rem;
  padding: 0 3rem 0 2.75rem;
  background: var(--s-bg-subtle);
  border: 1.5px solid var(--s-border);
  border-radius: var(--radius-full, 9999px);
  color: var(--s-text);
  font-size: 1rem;
  font-weight: 500;
  outline: none;
  font-family: inherit;
  transition: all 0.25s ease;
  box-shadow: none;
}

.search-input::placeholder {
  color: var(--s-text-muted);
  font-weight: 400;
}

.search-input:focus {
  background: var(--s-bg-elevated);
  border-color: var(--s-accent);
  box-shadow: 0 0 0 3px var(--s-accent-bg);
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--s-text-muted);
  pointer-events: none;
  transition: color 0.2s;
}

.search-input:focus ~ .search-icon {
  color: var(--s-accent);
}

/* Loading spinner in search */
.search-spinner {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: 2px solid var(--s-accent-bg);
  border-top-color: var(--s-accent);
  border-radius: 50%;
  animation: searchSpin 0.7s linear infinite;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.search-spinner.visible {
  opacity: 1;
}

@keyframes searchSpin {
  to { transform: translateY(-50%) rotate(360deg); }
}

/* Clear button */
.search-clear {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--s-bg-subtle);
  border: none;
  border-radius: 50%;
  color: var(--s-text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.search-clear.visible {
  display: flex;
}

.search-clear:hover {
  background: var(--s-hover);
  color: var(--s-text);
}

/* ===== SCOPE TABS (scrollable pills) ===== */
.scope-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: var(--space-md);
  padding: 2px 0;
}
.scope-tabs::-webkit-scrollbar { display: none; }

.scope-tab {
  flex-shrink: 0;
  padding: 0.55rem 1rem;
  background: transparent;
  border: 1.5px solid var(--s-border-strong);
  border-radius: var(--radius-full, 9999px);
  color: var(--s-text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  font-family: inherit;
  white-space: nowrap;
}

.scope-tab:hover {
  color: var(--s-text);
  background: var(--s-hover);
}

.scope-tab.active {
  color: #fff;
  background: var(--brand-gradient);
  border-color: transparent;
  box-shadow: none;
}

/* ===== FILTER CHIPS ===== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--space-md);
  min-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.filter-bar.hidden {
  max-height: 0;
  margin-bottom: 0;
  opacity: 0;
  pointer-events: none;
}

.filter-group {
  display: flex;
  gap: 0.35rem;
}

.filter-chip {
  padding: 0.45rem 0.8rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--s-text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-chip:hover {
  background: var(--s-hover);
  color: var(--s-text);
}

.filter-chip.active {
  background: var(--s-accent-bg-strong);
  color: var(--s-accent);
}

/* ===== RESULTS CONTAINER ===== */
.results-container {
  min-height: 200px;
}

/* Results header */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--s-border);
}

.results-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--s-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.results-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--s-accent);
  background: var(--s-accent-bg);
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
}

/* ===== POSTER GRID ===== */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

@media (min-width: 400px) {
  .poster-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 580px) {
  .poster-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (min-width: 768px) {
  .poster-grid { grid-template-columns: repeat(6, 1fr); gap: 1rem; }
}

/* Grid card */
.grid-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease;
}

.grid-card:hover {
  transform: translateY(-4px);
}

.grid-card:active {
  transform: scale(0.97);
}

.tmdb-card-btn {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.tmdb-card-btn:focus-visible {
  outline: 2px solid var(--s-accent);
  outline-offset: 2px;
  border-radius: 12px;
}

.grid-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-md, 10px);
  overflow: hidden;
  background: var(--s-bg-subtle);
  transition: box-shadow 0.25s ease;
}

.grid-card:hover .grid-poster {
  box-shadow: var(--s-shadow);
}

.grid-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--s-text-muted);
  background: linear-gradient(135deg, var(--s-bg-subtle), var(--s-bg));
}

.grid-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 3px;
}

.grid-badge::before {
  content: '⭐';
  font-size: 0.65rem;
}

.date-badge::before {
  content: '📅';
  font-size: 0.75rem;
}

.grid-meta {
  margin-top: 0.5rem;
  padding: 0 2px;
}

.grid-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--s-text);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.grid-sub {
  font-size: 0.75rem;
  color: var(--s-text-secondary);
  margin-top: 3px;
}

/* ===== USER/PERSON LIST ===== */
.user-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: var(--space-md, 0.85rem) 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--s-border);
  border-radius: 0;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  color: inherit;
}

.user-card:last-child { border-bottom: none; }

.user-card:hover {
  background: var(--s-hover);
}

.user-card.active {
  background: var(--s-active);
  border-color: var(--s-accent);
}

.user-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-full, 9999px);
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  overflow: hidden;
  color: #fff;
  font-weight: 800;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-meta {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--s-text);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-sub {
  font-size: 0.85rem;
  color: var(--s-text-secondary);
  margin: 3px 0 0 0;
}

.user-arrow {
  color: var(--s-text-muted);
  font-size: 1.2rem;
  font-weight: 300;
  transition: transform 0.2s;
}

.user-card:hover .user-arrow {
  transform: translateX(3px);
  color: var(--s-text-secondary);
}

/* ===== GENRE SELECTOR BUTTON ===== */
.genre-selector-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  background: var(--s-bg-subtle);
  border: 1px solid var(--s-border);
  border-radius: 14px;
  color: var(--s-text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  box-shadow: var(--s-shadow);
}

.genre-selector-btn:hover {
  background: var(--s-hover);
  border-color: var(--s-border-strong);
}

.genre-selector-btn.has-selection {
  background: var(--s-accent-bg);
  border-color: var(--s-accent);
  color: var(--s-text);
}

.genre-selector-btn .btn-text {
  flex: 1;
}

.genre-selector-btn .icon {
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--s-text-muted);
  transition: transform 0.2s;
}

.genre-selector-btn:hover .icon {
  transform: translateX(3px);
}

/* Selected genres tags */
.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: var(--space-md);
}

.selected-tags:empty {
  display: none;
}

.selected-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.65rem;
  background: var(--s-accent-bg);
  border: 1px solid var(--s-accent);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--s-accent);
}

.selected-tag button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.7;
  margin-left: 0.1rem;
}

.selected-tag button:hover {
  opacity: 1;
}

.clear-all-btn {
  padding: 0.4rem 0.65rem;
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.3);
  border-radius: 8px;
  color: var(--error);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.clear-all-btn:hover {
  background: rgba(244, 67, 54, 0.15);
}

/* ===== BOTTOM SHEET ===== */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.bottom-sheet-overlay.open {
  opacity: 1;
  visibility: visible;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 80vh;
  background: var(--sheet-bg);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  z-index: 1001;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 20px);
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.15);
}

.bottom-sheet-overlay.open .bottom-sheet {
  transform: translateY(0);
}

.bottom-sheet-handle {
  width: 40px;
  height: 5px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
  margin: 12px auto;
  flex-shrink: 0;
}

.bottom-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.25rem 1rem;
  flex-shrink: 0;
}

.bottom-sheet-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--s-text);
  margin: 0;
  display: flex;
  align-items: center;
}

.sheet-selected-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--s-accent);
  background: rgba(0, 122, 255, 0.12);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  margin-left: 0.6rem;
}

.bottom-sheet-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--s-bg-subtle);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  color: var(--s-text-secondary);
  cursor: pointer;
  font-size: 1.3rem;
  font-weight: 300;
  transition: all 0.2s;
}

.bottom-sheet-close:hover {
  background: var(--s-hover);
  color: var(--s-text);
}

/* Sheet search */
.sheet-search {
  padding: 0 1.25rem 1rem;
  flex-shrink: 0;
}

.sheet-search input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--s-bg-subtle);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  color: var(--s-text);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s;
}

.sheet-search input:focus {
  border-color: var(--s-accent);
  box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.12);
}

.sheet-search input::placeholder {
  color: var(--s-text-muted);
}

/* Sheet content */
.sheet-content {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 0;
  -webkit-overflow-scrolling: touch;
}

/* Genre list item */
.genre-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: background 0.15s;
}

.genre-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.genre-item.selected {
  background: rgba(0, 122, 255, 0.1);
}

.genre-checkbox {
  width: 24px;
  height: 24px;
  border: 2px solid var(--s-border-strong);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  background: var(--sheet-bg);
}

.genre-item.selected .genre-checkbox {
  background: var(--s-accent);
  border-color: var(--s-accent);
}

.genre-checkbox svg {
  width: 14px;
  height: 14px;
  color: var(--s-text);
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s;
}

.genre-item.selected .genre-checkbox svg {
  opacity: 1;
  transform: scale(1);
}

.genre-label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--s-text);
}

.genre-item.selected .genre-label {
  color: var(--s-accent);
  font-weight: 600;
}

/* Sheet footer */
.sheet-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
  background: var(--sheet-bg);
}

.sheet-btn {
  flex: 1;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.sheet-btn.secondary {
  background: var(--s-bg-subtle);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--s-text-secondary);
}

.sheet-btn.secondary:hover {
  background: var(--s-hover);
  color: var(--s-text);
}

.sheet-btn.primary {
  background: var(--s-accent);
  border: none;
  color: #fff;
}

.sheet-btn.primary:hover {
  filter: brightness(1.1);
}

/* ===== TITLES BLOCK (for selected genre/person) ===== */
.titles-block {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--s-border);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.titles-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.titles-block-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--s-text);
  margin: 0;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: var(--space-xl);
  padding: var(--space-md) 0;
}

.page-btn {
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--s-bg-subtle);
  border: 1px solid var(--s-border);
  border-radius: 10px;
  color: var(--s-text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
  background: var(--s-hover);
  color: var(--s-text);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-btn.active {
  background: var(--s-accent);
  border-color: var(--s-accent);
  color: var(--s-text);
}

.page-btn svg {
  width: 18px;
  height: 18px;
}

.page-ellipsis {
  padding: 0 0.35rem;
  color: var(--s-text-muted);
  font-size: 0.9rem;
}

/* ===== SKELETON ===== */
.skel {
  background: var(--s-bg-subtle);
  position: relative;
  overflow: hidden;
}

.skel::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--s-hover), transparent);
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  to { left: 100%; }
}

.skel-poster {
  aspect-ratio: 2 / 3;
  border-radius: 12px;
}

.skel-text {
  height: 12px;
  border-radius: 6px;
}

.skel-text.w-80 { width: 80%; }
.skel-text.w-60 { width: 60%; }

/* ===== EMPTY/HINT STATES ===== */
.search-page .hint {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--s-text-secondary);
  font-size: 0.95rem;
  font-style: normal;
  padding: var(--space-2xl) var(--space-lg);
  line-height: 1.5;
  border: none;
  border-left: none;
  background: none;
  margin: 0;
  /* Centra dentro grid */
  grid-column: 1 / -1;
  min-height: 150px;
}

.search-page .hint strong {
  color: var(--s-text);
  font-weight: 600;
}

.search-page .empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
}

.search-page .empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.search-page .empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--s-text);
  margin-bottom: 0.5rem;
}

.search-page .empty-text {
  font-size: 0.95rem;
  color: var(--s-text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.5;
}

.search-page .empty-text strong {
  color: var(--s-text);
}

.search-page .empty-note {
  margin: 0;
  color: var(--s-text-secondary);
  font-size: 0.88rem;
  line-height: 1.45;
}

.search-page .empty-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--s-accent);
  border: none;
  border-radius: 12px;
  color: var(--s-text);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px var(--s-accent-bg);
}

.search-page .empty-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--s-accent-bg);
}

/* ===== LOADING INDICATOR ===== */
.search-page .loading-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: var(--space-xl);
  color: var(--s-text-secondary);
  font-size: 0.95rem;
}

.search-page .loading-indicator .spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--s-accent-bg);
  border-top-color: var(--s-accent);
  border-radius: 50%;
  animation: searchSpinSimple 0.7s linear infinite;
}

/* ===== TMDB IMPORT MODAL ===== */
.tmdb-import-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
}

.tmdb-import-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 17, 0.52);
  backdrop-filter: blur(2px);
}

.tmdb-import-dialog {
  position: relative;
  margin: max(16vh, 80px) auto 0;
  width: min(92vw, 360px);
  border: 1px solid var(--s-border-strong);
  border-radius: 18px;
  padding: 1.1rem 1rem;
  background: var(--s-bg);
  box-shadow: var(--s-shadow-lg);
  text-align: center;
}

.tmdb-import-dialog h3 {
  margin: 0.25rem 0 0.35rem;
  color: var(--s-text);
  font-size: 1rem;
  font-weight: 800;
}

.tmdb-import-dialog p {
  margin: 0;
  color: var(--s-text-secondary);
  font-size: 0.9rem;
  line-height: 1.45;
}

.tmdb-import-spinner {
  width: 26px;
  height: 26px;
  margin: 0 auto;
  border: 3px solid var(--s-accent-bg);
  border-top-color: var(--s-accent);
  border-radius: 50%;
  animation: searchSpinSimple 0.75s linear infinite;
}

@keyframes searchSpinSimple {
  to { transform: rotate(360deg); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 400px) {
  .search-header h1 {
    font-size: 1.75rem;
  }

  .scope-tab {
    padding: 0.55rem 0.4rem;
    font-size: 0.82rem;
  }
  
  .filter-chip {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }
  
  .grid-title {
    font-size: 0.8rem;
  }
  
  .grid-sub {
    font-size: 0.7rem;
  }
  
  .page-btn {
    min-width: 2.25rem;
    height: 2.25rem;
  }
}

/* ===== TMDB RESULTS SECTION ===== */
#tmdbSection {
  margin-top: var(--space-xl, 1.5rem);
  padding-top: var(--space-lg, 1.25rem);
  border-top: 1px solid var(--s-border);
}

.tmdb-badge {
  background: rgba(1, 180, 228, 0.85) !important;
  font-size: 0.6rem !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
}

.tmdb-badge::before {
  content: '' !important;
}
