/* =========================================================
   Location Pill + Spotlight-style Browser
   The pill replaces the dock at bottom center. Tapping it opens
   a frosted-glass panel that rises from the pill, search-first.
   ========================================================= */

/* The pill replaces the dock entirely */
#location-dock {
  display: none !important;
}

/* =========================================================
   Pill — macOS Spotlight entry bar look
   ========================================================= */
#loc-pill {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom, 0));
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(420px, 78vw);
  padding: 12px 22px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  background: rgba(252, 252, 254, 0.72);
  -webkit-backdrop-filter: blur(20px) saturate(1.7);
  backdrop-filter: blur(20px) saturate(1.7);
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.22),
    0 2px 8px rgba(0, 0, 0, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 15.5px;
  font-weight: 500;
  color: #1d1d1f;
  cursor: pointer;
  z-index: 1200;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  touch-action: manipulation;
}

#loc-pill:hover {
  background: rgba(255, 255, 255, 0.88);
  transform: translateX(-50%) scale(1.03);
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.26),
    0 2px 8px rgba(0, 0, 0, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

#loc-pill:active {
  transform: translateX(-50%) scale(0.98);
}

#loc-pill svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: #6e6e73;
  margin-left: -9px;
}

#loc-pill-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Fallback (park name, not a specific location) — subtler styling */
#loc-pill.fallback #loc-pill-label {
  color: #86868b;
}

/* Pill hides while the panel is open (the panel's search bar replaces it) */
body.locbrowser-open #loc-pill {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) scale(0.92);
}

/* =========================================================
   Backdrop — subtle dim, like Spotlight focusing attention
   ========================================================= */
#locbrowser-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 2400;
}

#locbrowser-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* =========================================================
   Panel — frosted glass, rises from the pill position
   ========================================================= */
#locbrowser {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0));
  transform: translateX(-50%) translateY(14px) scale(0.97);
  width: min(460px, 94vw);
  max-height: min(58vh, 540px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 18px;
  background: rgba(250, 250, 252, 0.82);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  backdrop-filter: blur(28px) saturate(1.8);
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.30),
    0 2px 10px rgba(0, 0, 0, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 2500;
  overflow: hidden;
}

#locbrowser.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* =========================================================
   Search row — the Spotlight hero element
   ========================================================= */
#locbrowser-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  padding: 15px 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

#locbrowser-search-row > svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: #8e8e93;
}

#locbrowser-search {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 18px;
  font-weight: 400;
  color: #1d1d1f;
}

#locbrowser-search::placeholder {
  color: #98989d;
}

/* Hide native clear button (we have our own close) */
#locbrowser-search::-webkit-search-cancel-button {
  display: none;
}

#locbrowser-close {
  appearance: none;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.07);
  color: #6e6e73;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

#locbrowser-close:hover {
  background: rgba(0, 0, 0, 0.13);
}

/* =========================================================
   Results list
   ========================================================= */
#locbrowser-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px 8px 12px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Category group */
.locgroup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 12px 10px 7px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #86868b;
}

.locgroup-header .locgroup-count {
  font-weight: 400;
  color: #b0b0b5;
  margin-left: 5px;
}

.locgroup-header .locgroup-chevron {
  transition: transform 0.18s ease;
  color: #b0b0b5;
  flex: 0 0 auto;
}

.locgroup.expanded .locgroup-chevron {
  transform: rotate(90deg);
}

.locgroup-items {
  display: none;
}

.locgroup.expanded .locgroup-items {
  display: block;
}

/* Location row */
.locitem {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: none;
  border: none;
  padding: 8px 10px;
  border-radius: 11px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 15px;
  color: #1d1d1f;
  transition: background 0.12s ease;
}

.locitem:hover,
.locitem.kbd-focus {
  background: rgba(0, 113, 227, 0.10);
}

.locitem.current {
  background: rgba(0, 113, 227, 0.14);
  font-weight: 600;
  color: #0a3d91;
}

.locitem img {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
}

.locitem .locitem-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* No-results message */
#locbrowser-empty {
  display: none;
  padding: 26px 16px;
  text-align: center;
  color: #98989d;
  font-size: 14.5px;
}

/* =========================================================
   Date Pill + Menu — same aesthetic, positioned at top
   ========================================================= */
#date-pill {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top, 0));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  background: rgba(252, 252, 254, 0.72);
  -webkit-backdrop-filter: blur(20px) saturate(1.7);
  backdrop-filter: blur(20px) saturate(1.7);
  box-shadow:
    0 6px 24px rgba(0, 0, 0, 0.18),
    0 2px 6px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #1d1d1f;
  z-index: 1200;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  touch-action: manipulation;
}

#date-pill:hover {
  background: rgba(255, 255, 255, 0.88);
}

/* Prev / next arrow buttons inside the pill */
#date-pill-prev,
#date-pill-next {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #6e6e73;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
  flex: 0 0 auto;
}

#date-pill-prev:hover,
#date-pill-next:hover {
  background: rgba(0, 0, 0, 0.07);
}

#date-pill-prev svg,
#date-pill-next svg {
  width: 14px;
  height: 14px;
}

#date-pill-prev.disabled,
#date-pill-next.disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* Center section: calendar icon + label + chevron, opens the menu */
#date-pill-main {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 7px;
  border: none;
  background: transparent;
  padding: 5px 8px;
  border-radius: 999px;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
  min-width: 0;
}

#date-pill-main:hover {
  background: rgba(0, 0, 0, 0.05);
}

#date-pill-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Hide pill while panel is open */
body.datebrowser-open #date-pill {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) scale(0.92);
}

/* =========================================================
   Compare Mode — transform pill to show two dates
   ========================================================= */

/* Hide compare elements by default */
#date-pill-cmp-prev,
#date-pill-left,
#date-pill-vs,
#date-pill-right,
#date-pill-cmp-next {
  display: none;
}

/* In compare mode, hide single-date elements and show compare elements */
#date-pill.compare-mode #date-pill-prev,
#date-pill.compare-mode #date-pill-main,
#date-pill.compare-mode #date-pill-next {
  display: none;
}

#date-pill.compare-mode #date-pill-cmp-prev,
#date-pill.compare-mode #date-pill-left,
#date-pill.compare-mode #date-pill-vs,
#date-pill.compare-mode #date-pill-right,
#date-pill.compare-mode #date-pill-cmp-next {
  display: flex;
}

/* Compare mode arrow buttons — same style as single-mode arrows.
   No display here: hidden by default, .compare-mode turns them on. */
#date-pill-cmp-prev,
#date-pill-cmp-next {
  appearance: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #6e6e73;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
  flex: 0 0 auto;
}

#date-pill-cmp-prev:hover,
#date-pill-cmp-next:hover {
  background: rgba(0, 0, 0, 0.07);
}

#date-pill-cmp-prev svg,
#date-pill-cmp-next svg {
  width: 14px;
  height: 14px;
}

#date-pill-cmp-prev.disabled,
#date-pill-cmp-next.disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* Left date button (older) */
#date-pill-left {
  appearance: none;
  align-items: center;
  border: none;
  background: transparent;
  padding: 5px 10px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #1d1d1f;
  cursor: pointer;
  transition: background 0.15s ease;
  min-width: 0;
}

#date-pill-left:hover {
  background: rgba(0, 0, 0, 0.06);
}

#date-pill-left-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 95px;
}

/* "vs" separator */
#date-pill-vs {
  font-size: 11px;
  font-weight: 600;
  color: #86868b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 0 2px;
  user-select: none;
}

/* Right date button (newer) */
#date-pill-right {
  appearance: none;
  align-items: center;
  border: none;
  background: transparent;
  padding: 5px 10px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #1d1d1f;
  cursor: pointer;
  transition: background 0.15s ease;
  min-width: 0;
}

#date-pill-right:hover {
  background: rgba(0, 0, 0, 0.06);
}

#date-pill-right-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 95px;
}

/* Also hide compare mode pill when browser is open */
body.datebrowser-open #date-pill.compare-mode {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) scale(0.92);
}

/* Date browser backdrop */
#datebrowser-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 2400;
}

#datebrowser-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Date browser panel — drops down from pill position */
#datebrowser {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top, 0));
  left: 50%;
  transform: translateX(-50%) translateY(-10px) scale(0.97);
  width: min(210px, 64vw);
  max-height: min(52vh, 420px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 18px;
  background: rgba(250, 250, 252, 0.82);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  backdrop-filter: blur(28px) saturate(1.8);
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.30),
    0 2px 10px rgba(0, 0, 0, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 2500;
  overflow: hidden;
}

#datebrowser.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

#datebrowser-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

#datebrowser-title {
  font-size: 14px;
  font-weight: 600;
  color: #1d1d1f;
  margin: 0;
}

#datebrowser-close {
  appearance: none;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.07);
  color: #6e6e73;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

#datebrowser-close:hover {
  background: rgba(0, 0, 0, 0.13);
}

#datebrowser-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Date item row */
.dateitem {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: none;
  border: none;
  padding: 11px 14px;
  border-radius: 11px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  font-size: 15px;
  color: #1d1d1f;
  transition: background 0.12s ease;
}

.dateitem:hover,
.dateitem.kbd-focus {
  background: rgba(0, 113, 227, 0.10);
}

.dateitem.current {
  background: rgba(0, 113, 227, 0.14);
  font-weight: 600;
  color: #0a3d91;
}

/* Hide original date nav row in this mockup */
#date-nav-row {
  display: none !important;
}

/* =========================================================
   About screen — match the frosted-glass flyout style
   ========================================================= */
#info-overlay {
  background: rgba(0, 0, 0, 0.18);
  color: #1d1d1f;
  /* Override display:none with opacity for smooth animation */
  display: flex !important;
  align-items: flex-start;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

#info-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

#info-overlay .panel {
  max-width: 560px;
  margin: 60px 20px;
  padding: 22px 24px 18px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 18px;
  background: rgba(250, 250, 252, 0.82);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  backdrop-filter: blur(28px) saturate(1.8);
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.30),
    0 2px 10px rgba(0, 0, 0, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  transform: translateY(-10px) scale(0.97);
  transition: transform 0.22s ease, opacity 0.22s ease;
  opacity: 0;
}

#info-overlay.open .panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

#info-overlay .panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

#info-overlay h2 {
  font-size: 17px;
  font-weight: 600;
  color: #1d1d1f;
  margin: 0;
}

#info-overlay h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #86868b;
  margin: 18px 0 6px;
}

#info-overlay .panel section {
  font-size: 14.5px;
  color: #1d1d1f;
}

#info-overlay .panel ul {
  color: #515154;
}

#info-overlay a {
  color: #0071e3;
  text-decoration: none;
}

#info-overlay a:hover {
  color: #0a3d91;
  text-decoration: underline;
}

#info-close {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.07);
  color: #6e6e73;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

#info-close:hover {
  background: rgba(0, 0, 0, 0.13);
}

/* =========================================================
   Park selector — flyout style matching date browser
   ========================================================= */
/* app.css hides these with display:none and the JS now toggles the
   "open" class instead, so keep them rendered and animate opacity */
#parks-overlay {
  display: block !important;
  background: rgba(0, 0, 0, 0.18) !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

#parks-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

#parks-modal {
  display: flex !important;
  flex-direction: column;
  position: fixed !important;
  top: calc(50% - 20px) !important;
  left: 50% !important;
  transform: translate(-50%, -50%) scale(0.97) !important;
  width: min(280px, 80vw) !important;
  max-height: min(60vh, 480px) !important;
  border: 1px solid rgba(255, 255, 255, 0.65) !important;
  border-radius: 18px !important;
  background: rgba(250, 250, 252, 0.82) !important;
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  backdrop-filter: blur(28px) saturate(1.8);
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.30),
    0 2px 10px rgba(0, 0, 0, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  overflow: hidden;
}

#parks-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1) !important;
}

#parks-modal header {
  display: flex;
  align-items: center;
  justify-content: space-between !important;
  padding: 14px 16px 10px !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
  background: transparent !important;
}

#parks-modal header h3 {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #1d1d1f !important;
  margin: 0;
  width: auto !important;
  text-align: left !important;
}

#parks-close {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: none !important;
  border-radius: 50% !important;
  background: rgba(0, 0, 0, 0.07) !important;
  color: #6e6e73 !important;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 0 !important;
  cursor: pointer;
  transition: background 0.15s ease;
}

#parks-close:hover {
  background: rgba(0, 0, 0, 0.13) !important;
}

#parks-modal .body {
  padding: 8px !important;
  overflow-y: auto;
  max-height: calc(60vh - 60px);
}

#parks-modal .parks-list {
  display: block;
  width: 100%;
}

/* Buttons are created as .park-pick-btn / .is-current (see app.js) */
#parks-modal .park-pick-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: none;
  border: none;
  padding: 11px 14px;
  border-radius: 11px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  font-size: 15px;
  color: #1d1d1f;
  transition: background 0.12s ease;
}

#parks-modal .park-pick-btn:hover {
  background: rgba(0, 113, 227, 0.10);
}

#parks-modal .park-pick-btn.is-current,
#parks-modal .park-pick-btn.is-current:hover {
  background: rgba(0, 113, 227, 0.14);
  border: none;
  font-weight: 600;
  color: #0a3d91;
}

/* =========================================================
   Mobile tweaks
   ========================================================= */
@media (max-width: 600px) {
  #loc-pill {
    font-size: 15px;
    padding: 11px 18px;
  }

  #locbrowser {
    width: 94vw;
    max-height: 52dvh;
  }

  #locbrowser-search {
    font-size: 16px; /* >=16px prevents iOS auto-zoom on focus */
  }
}
