/* search.css */
#overlay,
#search-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay-medium);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 10000;
}

#overlay.active,
#search-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

#search-panel  {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.98);
  width: min(720px, calc(100% - 24px));
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-search);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 12000;
  display: flex;
  flex-direction: column;
  min-height: 570px;
}

#search-panel.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.search-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

#search-input {
  flex: 1;
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text);
  padding: 0 12px;
  font-size: 1rem;
  outline: none;
}

#search-input::placeholder {
  color: var(--text-placeholder);
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted-8);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--border-subtle);
}

#search-suggestions {
  flex: 1;
  max-height: 50vh;
  min-height: 220px;
  overflow: auto;
  list-style: none;
  margin: 0;
  padding: 6px;
  display: flex;
  flex-direction: column;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
}

.suggestion-item:hover,
.suggestion-item[aria-selected="true"] {
  background: var(--hover-strong);
}

.suggestion-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.suggestion-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-flag {
  width: 18px;
  height: 12px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--panel-3);
}

.suggestion-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  gap: 8px;
  color: var(--text-muted-3);
  text-align: center;
  height: 100%;
  margin: auto 0;
}

.suggestion-empty-icon {
  font-size: 1.8rem;
  opacity: 0.9;
}

.suggestion-empty-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.suggestion-empty-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted-4);
}

.search-footer {
  padding: 8px 12px 12px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted-4);
  font-size: 0.85rem;
}

.search-footer kbd {
  background: var(--hover-strong);
  border: 1px solid var(--border-alt);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.8em;
}

#city-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: min(520px, 92vw);
  height: 100%;
  background: var(--panel);
  color: var(--text);
  border-right: 1px solid var(--border-subtle);
  transform: translateX(-100%);
  opacity: 0;
  transition: transform 250ms ease, opacity 200ms ease;
  z-index: 850;
  display: flex;
  -webkit-box-shadow: var(--shadow-sidebar);
  box-shadow: var(--shadow-sidebar);
  flex-direction: column;
}

#city-sidebar.active {
  transform: translateX(0);
  opacity: 1;
}

#city-sidebar .icon-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

.city-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--bg-hero);
  overflow: hidden;
}

#city-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: auto;
}

.city-hero-gradient {
  position: absolute;
  inset: 0;
  background: var(--gradient-city-hero);
}

.city-hero-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.city-hero-text {
  display: flex;
  flex-direction: column;
}

#city-name {
  margin: 0 0 2px;
  font-weight: 700;
}

#city-region {
  margin: 0;
  color: var(--text-muted-2);
  font-size: 0.95rem;
  font-weight: 400;
}

.city-hero-weather {
  display: flex;
  align-items: center;
  gap: 8px;
}

#city-weather-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  border: none;
}

#city-weather-temp {
  font-size: 1rem;
  font-weight: 600;
}

#bullet {
  margin-left: 8px;
  margin-right: 8px;
}

.city-forecast-btn {
  color: var(--text-subtle);
  text-decoration: none;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.city-forecast-btn:hover {
  text-decoration: underline;
}

.city-details {
  padding: 12px;
  overflow: auto;
}

.city-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.city-stat .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted-3);
}

.city-stat .stat-value {
  font-size: 1rem;
  margin-top: 2px;
}

.city-wiki h3 {
  margin: 0 0 6px;
  font-size: 1.3rem;
}

.city-wiki p {
  margin: 0 0 8px;
  color: var(--text-muted-13);
}

.city-wiki a {
  color: var(--text-subtle);
  text-decoration: none;
}

.city-wiki a:hover {
  text-decoration: underline;
}

#city-wiki-excerpt {
  color: var(--text);
}

.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}
