/*
 * zuhora/css/modal.css
 * -----------------------------------------------------------------------------
 * Add-city modal - slides up from bottom on mobile, centred on desktop.
 * -----------------------------------------------------------------------------
 */

/* -- Overlay -------------------------------------------------------------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(13, 10, 26, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

/* -- Sheet ---------------------------------------------------------------- */
.modal {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-accent);
  width: 100%;
  max-width: 600px;
  padding: var(--space-8) var(--space-6) 40px;
  transform: translateY(100%);
  transition: transform var(--duration-slow) var(--ease-out);
}

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

/* -- Header --------------------------------------------------------------- */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.modal-title {
  font-size: var(--text-base);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  /* --text-muted: 4.66:1 on --bg-surface - WCAG AA ✓ */
  color: var(--text-muted);
}

.modal-close {
  font-size: 22px;
  /* --text-secondary: 6.61:1 on --bg-surface - WCAG AA ✓ */
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  background: none;
  border: none;
  font-family: inherit;
  padding: var(--space-2) var(--space-3);
  /* min 44×44 tap target - WCAG 2.5.5 */
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--duration-mid);
  -webkit-tap-highlight-color: transparent;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* -- Search input --------------------------------------------------------- */
.modal-search {
  width: 100%;
  background: rgba(13, 10, 26, 0.70);
  border: 1px solid var(--border-mid);
  /* --text-primary: 18.41:1 on near-midnight bg - WCAG AAA ✓ */
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 300;
  padding: 14px var(--space-5);
  outline: none;
  margin-bottom: var(--space-4);
  transition: border-color var(--duration-mid);
  -webkit-appearance: none;
  border-radius: 0;
}

.modal-search::placeholder {
  /* --text-muted: 4.66:1 - WCAG AA ✓ */
  color: var(--text-muted);
}

.modal-search:focus {
  border-color: var(--border-accent-hi);
}

/* -- City list ------------------------------------------------------------ */
.modal-list {
  list-style: none;
  max-height: 52vh;
  overflow-y: auto;
  /* Prevent scroll chaining on iOS */
  overscroll-behavior: contain;
}

/* Custom scrollbar - decorative */
.modal-list::-webkit-scrollbar       { width: 3px; }
.modal-list::-webkit-scrollbar-track { background: transparent; }
.modal-list::-webkit-scrollbar-thumb { background: var(--border-accent); }

/* -- List item ------------------------------------------------------------ */
.modal-item {
  padding: 14px var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  /* min 44px height - WCAG 2.5.5 */
  min-height: 44px;
  transition: background var(--duration-fast);
  -webkit-tap-highlight-color: transparent;
  gap: var(--space-4);
}

.modal-item:hover,
.modal-item:active {
  background: rgba(201, 168, 76, 0.07);
}

.modal-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.modal-item[aria-disabled="true"] {
  opacity: 0.38;
  pointer-events: none;
}

.modal-city {
  font-size: var(--text-lg);
  font-weight: 300;
  /* --text-primary: 16.75:1 on --bg-surface - WCAG AAA ✓ */
  color: var(--text-primary);
}

.modal-country {
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  /* --text-muted: 4.66:1 - WCAG AA ✓ */
  color: var(--text-muted);
  margin-top: 2px;
}

.modal-tz {
  font-size: var(--text-base);
  /* --accent: 7.78:1 on --bg-surface - WCAG AA ✓ */
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
