/* Airportparkfinder — hand-written styles that Tailwind utilities don't cover. */

:root {
  --brand-navy: #1A365D;
  --brand-emerald: #059669;
  --brand-emerald-deep: #047857;
  --brand-slate: #64748B;
}

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Tabular figures keep prices and times aligned in lists and the matrix. */
.tnum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Consistent, visible keyboard focus on every interactive element. */
:focus-visible {
  outline: 3px solid var(--brand-emerald);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip link: hidden until focused. */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--brand-navy);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: top 120ms ease;
}
.skip-link:focus {
  top: 1rem;
}

/* ---- Components shared by markup and JS-rendered content ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-lg {
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  line-height: 1.5rem;
}
.btn-primary {
  background: var(--brand-emerald-deep);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: #065F46;
}
.btn-secondary {
  background: #fff;
  color: var(--brand-navy);
  border: 1px solid #CBD5E1;
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--brand-navy);
  background: #F8FAFC;
}
.btn-secondary[aria-pressed="true"] {
  background: #EAF0F7;
  border-color: var(--brand-navy);
}
.btn-light {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.btn-light:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

.label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--brand-navy);
}
.input {
  display: block;
  width: 100%;
  border: 1px solid #CBD5E1;
  border-radius: 0.5rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.95rem;
  line-height: 1.5rem;
  color: var(--brand-navy);
  background: #fff;
}
.input:focus {
  outline: 3px solid var(--brand-emerald);
  outline-offset: 0;
  border-color: var(--brand-emerald);
}
.input:invalid:not(:focus):not(:placeholder-shown) {
  border-color: #B45309;
}
.input[aria-invalid="true"] {
  border-color: #B91C1C;
}
textarea.input {
  resize: vertical;
}

/* Suburb list under the postcode field (lib/combobox.js). */
.combobox-list {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  max-height: min(18rem, 50vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #CBD5E1;
  border-radius: 0.5rem;
  background: #fff;
  padding: 0.25rem 0;
  box-shadow: 0 10px 25px -5px rgb(15 23 42 / 0.15);
}
.combobox-option {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  color: var(--brand-navy);
}
.combobox-option:hover {
  background: #F1F5F9;
}
.combobox-option[aria-selected="true"] {
  background: var(--brand-navy);
  color: #fff;
}
.combobox-option-detail {
  margin-left: 0.375rem;
  font-size: 0.875rem;
  color: #475569;
}
.combobox-option[aria-selected="true"] .combobox-option-detail {
  color: #E2E8F0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 9999px;
  background: #F1F5F9;
  color: var(--brand-navy);
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  line-height: 1.25rem;
  font-weight: 500;
}
.badge-emerald {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 9999px;
  background: #ECFDF5;
  color: var(--brand-emerald-deep);
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  line-height: 1.25rem;
  font-weight: 600;
}
/* Overstay Orange is only ever a background with navy text (5.7:1). */
.badge-amber {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 9999px;
  background: #F59E0B;
  color: var(--brand-navy);
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  line-height: 1.25rem;
  font-weight: 600;
}

/* Checkbox styled as a switch (used for "Highlight differences"). */
.switch {
  appearance: none;
  -webkit-appearance: none;
  width: 2.75rem;
  height: 1.5rem;
  border-radius: 9999px;
  background: #CBD5E1;
  position: relative;
  cursor: pointer;
  transition: background-color 120ms ease;
  flex-shrink: 0;
}
.switch::after {
  content: "";
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 120ms ease;
}
.switch:checked {
  background: var(--brand-emerald-deep);
}
.switch:checked::after {
  transform: translateX(1.25rem);
}

/* Range sliders */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 9999px;
  background: #E2E8F0;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-navy);
  border: 3px solid #fff;
  box-shadow: 0 1px 3px rgba(26, 54, 93, 0.4);
}
input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-navy);
  border: 3px solid #fff;
  box-shadow: 0 1px 3px rgba(26, 54, 93, 0.4);
}

/* Native dialogs */
dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
}
dialog::backdrop {
  background: rgba(26, 54, 93, 0.55);
  backdrop-filter: blur(2px);
}

/* Mobile comparison matrix: horizontal snap between operator cards. */
.snap-row {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
}
.snap-row > * {
  scroll-snap-align: center;
  flex: 0 0 85%;
}

/* Rows whose values are identical across all compared operators, when "Highlight differences" is on. */
.matrix-muted {
  color: #94A3B8;
}
.matrix-muted * {
  color: inherit !important;
  font-weight: 400 !important;
}

/* Filter rail becomes a full-screen drawer below the lg breakpoint. */
@media (max-width: 1023px) {
  .rail-open {
    position: fixed;
    inset: 0;
    z-index: 40;
    overflow-y: auto;
    background: #fff;
    padding: 1.5rem;
  }
}

/* Loading skeletons */
.skeleton {
  position: relative;
  overflow: hidden;
  background: #E2E8F0;
  border-radius: 0.5rem;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* Thin, quiet scrollbars for data regions */
.scroll-quiet {
  scrollbar-width: thin;
  scrollbar-color: #CBD5E1 transparent;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .skeleton::after {
    animation: none;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
