/* Search overlay — full-screen dark backdrop + centered panel */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  animation: fade-in var(--t-medium) ease-out;
}

.search-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.search-overlay__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding-top: calc(var(--space-lg) + var(--safe-top));
  display: flex;
  flex-direction: column;
  height: 100%;
}

.search-overlay__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0 var(--space-md) var(--space-md);
}

.search-overlay__input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  padding: var(--space-sm) var(--space-md);
  outline: none;
  transition: border-color var(--t-fast);
}
.search-overlay__input:focus {
  border-color: rgba(255, 255, 255, 0.3);
}
.search-overlay__input::placeholder {
  color: var(--text-muted);
}
.search-overlay__input::-webkit-search-cancel-button { display: none; }

.search-overlay__close {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast);
}
.search-overlay__close:hover { background: var(--bg-elevated); }

.search-overlay__results {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--space-md) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.search-overlay__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: var(--space-sm) 0;
}

.search-overlay__empty {
  color: var(--text-secondary);
  text-align: center;
  padding: var(--space-xl) 0;
  font-size: 0.95rem;
}

/* Result row */
.search-result-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.search-result-row:hover,
.search-result-row:active {
  background: var(--bg-elevated);
}

.search-result-row__poster {
  width: 32px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-elevated);
}
.search-result-row__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.search-result-row__info {
  flex: 1;
  min-width: 0;
}
.search-result-row__title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-row__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Search bar — persistent, below the top icons row */
/* top icons bottom: settings-btn top(52px) + height(44px) + gap(8px) = 104px */
.search-bar {
  position: fixed;
  top: calc(var(--space-lg) + var(--safe-top, 0px) + 28px + 44px + var(--space-sm));
  left: var(--space-md);
  right: var(--space-md);
  z-index: 50;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--t-fast);
}
.search-bar:hover { background: rgba(0, 0, 0, 0.65); }
.search-bar__icon { font-size: 0.9rem; opacity: 0.55; flex-shrink: 0; }
.search-bar__placeholder { color: rgba(255, 255, 255, 0.4); font-size: 0.88rem; }
