/* Lowcountry Advisor – Hilton Head Bike Map – Mobile Web */

:root {
  --gold: #c9a227;
  --gold-light: #e5c76b;
  --gold-dark: #9a7b1a;
  --black: #0f0f0f;
  --black-soft: #1a1a1a;
  --charcoal: #2d2d2d;
  --white: #ffffff;
  --off-white: #f5f5f0;
  --safe-top: env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing: antialiased; background: var(--black); color: var(--off-white); }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* Splash */
.splash {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--black); display: flex; align-items: center; justify-content: center;
  padding: calc(var(--safe-top) + 40px) 32px calc(var(--safe-bottom) + 40px);
  transition: opacity 1.2s ease-out;
  pointer-events: auto;
}
.splash.splash-fade-out { opacity: 0; pointer-events: none; }
.splash.splash-fade-out.hidden { display: none; }
.splash-inner { text-align: center; }
.splash-logo { width: 40vw; max-width: 160px; height: auto; margin-bottom: 24px; }
.splash-title { font-size: 22px; font-weight: 700; color: var(--gold); margin: 0 0 12px; }
.splash-subtitle { font-size: 15px; color: var(--gold-light); opacity: 0.9; margin: 0 0 4px; }
.splash-byline { font-size: 18px; font-weight: 600; color: var(--gold); margin: 0; }

/* App container */
.app {
  height: 100%; display: flex; flex-direction: column; padding-top: var(--safe-top); padding-bottom: var(--safe-bottom);
  position: relative; z-index: 0; opacity: 0; transition: opacity 1.2s ease-out;
}
.app.app-visible { opacity: 1; }
.app.hidden { display: none !important; }

/* Header */
.header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--black); border-bottom: 2px solid var(--gold); }
.header-back { font-size: 24px; color: var(--gold); padding: 4px 8px; margin: -4px 4px -4px -4px; min-width: 36px; }
.header-logo { width: 32px; height: 32px; object-fit: contain; }
.header-title { font-size: 18px; font-weight: 600; color: var(--gold); flex: 1; }

/* Screens */
.screen { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.screen:not(.screen-home) { display: flex; flex-direction: column; }

/* Home */
.screen-home { padding: 0; background: var(--black); }
.home-bg {
  position: absolute; inset: 0; background-size: 100% auto; background-position: center top; background-repeat: no-repeat; background-color: var(--black);
}
.home-logo {
  position: absolute; top: 10%; left: 50%; transform: translateX(-50%); width: 36vw; height: 36vw; max-width: 140px; max-height: 140px; object-fit: contain; pointer-events: none;
}
.home-hit {
  position: absolute; bottom: 0; top: 33.33%; width: 50%;
}
.home-hit-left { left: 0; }
.home-hit-right { left: 50%; }
.home-hit:active { background: rgba(201, 162, 39, 0.15); }

/* Map */
.screen-map { position: relative; }
.map-container { flex: 1; width: 100%; min-height: 200px; }
.map-overlay {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 16px; padding-bottom: calc(max(16px, var(--safe-bottom)) + 12px);
  background: rgba(15,15,15,0.96); border-top-left-radius: 16px; border-top-right-radius: 16px; border-top: 2px solid var(--gold);
}
.map-overlay-logo-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 12px; }
.map-overlay-logo { width: 36px; height: 36px; object-fit: contain; }
.map-overlay-tagline { font-size: 14px; font-weight: 600; color: var(--gold); }
.map-overlay-btn { display: block; text-align: center; padding: 14px 20px; border-radius: 12px; margin-bottom: 12px; font-size: 16px; font-weight: 600; }
.map-overlay-btn-primary { background: var(--gold); color: var(--black); }
.map-overlay-btn-outline { background: transparent; color: var(--gold); border: 2px solid var(--gold); padding: 10px 16px; font-size: 15px; }
.map-overlay-links { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.map-overlay-link { color: var(--gold-light); font-size: 14px; }

/* Tours */
.screen-tours { background: var(--black-soft); overflow-y: auto; }
.tours-header { padding: 20px 16px; background: var(--black); border-bottom: 2px solid var(--gold); }
.tours-header-logo { width: 44px; height: 44px; display: block; margin: 0 auto 10px; object-fit: contain; }
.tours-title { font-size: 22px; font-weight: 700; color: var(--gold); text-align: center; margin: 0; }
.tours-subtitle { font-size: 14px; color: var(--gold-light); margin-top: 4px; text-align: center; opacity: 0.9; }
.tours-list { padding: 16px; padding-bottom: 24px; flex: 1; }
.tour-card {
  background: var(--charcoal); border-radius: 12px; padding: 16px; margin-bottom: 12px; border-left: 4px solid var(--gold);
}
.tour-card-title { font-size: 17px; font-weight: 600; color: var(--white); margin: 0; }
.tour-card-meta { font-size: 13px; color: var(--gold-light); margin-top: 4px; opacity: 0.9; }
.tour-card-desc { font-size: 14px; color: var(--off-white); margin-top: 8px; line-height: 1.4; opacity: 0.9; }
.tours-footer { margin: 8px 16px 32px; padding: 16px; background: var(--charcoal); border-radius: 12px; border: 1px solid var(--gold-dark); }
.tours-footer-text { font-size: 13px; color: var(--gold-light); margin: 0; }
.tours-safety { font-size: 12px; color: var(--gold-light); margin-top: 8px; font-style: italic; opacity: 0.85; }

/* Tour Detail */
.screen-tour-detail { background: var(--black-soft); overflow-y: auto; }
.tour-detail-map { height: 200px; width: 100%; position: relative; }
.tour-detail-badge { position: absolute; top: 12px; right: 12px; padding: 6px 12px; border-radius: 8px; font-weight: 700; font-size: 14px; color: #fff; }
.tour-detail-body { padding: 20px; padding-bottom: 32px; }
.tour-detail-title { font-size: 22px; font-weight: 700; color: var(--gold); margin: 0; }
.tour-detail-start { font-size: 16px; font-weight: 600; color: var(--gold-light); margin: 8px 0 4px; }
.tour-detail-address { font-size: 14px; color: var(--gold-light); margin: 0; opacity: 0.85; }
.tour-detail-desc { font-size: 15px; color: var(--off-white); margin-top: 16px; line-height: 1.5; opacity: 0.9; }
.tour-detail-nav-btn { display: block; text-align: center; background: var(--gold); color: var(--black); padding: 14px; border-radius: 12px; margin-top: 24px; font-weight: 600; font-size: 16px; }
.tour-detail-map-link { display: block; text-align: center; margin-top: 12px; color: var(--gold-light); font-size: 15px; }

/* Directions panel */
.directions-panel {
  position: fixed; top: calc(var(--safe-top) + 56px); left: 0; right: 0; bottom: 0; z-index: 100;
  display: flex; flex-direction: column; background: var(--black-soft);
}
.directions-panel-header { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--black); border-bottom: 2px solid var(--gold); }
.directions-panel-title { margin: 0; font-size: 18px; font-weight: 600; color: var(--gold); }
.directions-panel-close { background: none; border: none; color: var(--gold); font-size: 28px; line-height: 1; padding: 0 8px; cursor: pointer; }
.directions-map { flex: 1; min-height: 200px; }
.directions-open-google { flex-shrink: 0; display: block; text-align: center; background: var(--gold); color: var(--black); padding: 14px 20px; margin: 16px; border-radius: 12px; font-size: 16px; font-weight: 600; }

/* Eats */
.screen-eats { background: var(--black-soft); overflow: hidden; }
.eats-header { flex-shrink: 0; padding: 20px 16px; background: var(--black); border-bottom: 2px solid var(--gold); }
.eats-header-logo { width: 44px; height: 44px; display: block; margin: 0 auto 10px; object-fit: contain; }
.eats-title { font-size: 22px; font-weight: 700; color: var(--gold); text-align: center; margin: 0; }
.eats-subtitle { font-size: 14px; color: var(--gold-light); margin-top: 4px; text-align: center; opacity: 0.9; }
.eats-filters { flex-shrink: 0; display: flex; gap: 8px; padding: 10px 16px; background: var(--black); overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
.eats-filter-chip { padding: 8px 14px; border-radius: 20px; background: var(--charcoal); border: 1px solid var(--gold-dark); font-size: 14px; font-weight: 500; color: var(--gold-light); white-space: nowrap; flex-shrink: 0; }
.eats-filter-chip.active { background: var(--gold); border-color: var(--gold); color: var(--black); }
.eats-list { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; padding-bottom: 32px; }
.eat-card {
  background: var(--charcoal); border-radius: 12px; padding: 16px; margin-bottom: 12px; border-left: 4px solid var(--gold);
}
.eat-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.eat-card-name { font-size: 17px; font-weight: 700; color: var(--white); margin: 0; flex: 1; }
.eat-card-type { padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; color: var(--black); }
.eat-card-near { font-size: 13px; color: var(--gold-light); margin-top: 6px; opacity: 0.95; }
.eat-card-desc { font-size: 14px; color: var(--off-white); margin: 8px 0 0; line-height: 1.4; opacity: 0.9; }
.eat-card-directions { display: inline-block; margin-top: 12px; background: var(--gold); color: var(--black); padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; border: none; cursor: pointer; font-family: inherit; }
.eats-empty { padding: 24px; text-align: center; color: var(--gold-light); opacity: 0.8; }

/* Leaflet overrides */
.leaflet-container { background: var(--black-soft); font-family: inherit; }
.leaflet-popup-content-wrapper { background: var(--charcoal); color: var(--off-white); border: 1px solid var(--gold); }
.leaflet-popup-tip { background: var(--charcoal); }
.leaflet-popup-content { margin: 10px 14px; font-size: 14px; }
.leaflet-control-zoom { border: none !important; }
.leaflet-control-zoom a { background: var(--charcoal) !important; color: var(--gold) !important; border: 1px solid var(--gold-dark) !important; }
.leaflet-control-attribution { background: rgba(0,0,0,0.5) !important; color: var(--gold-light); font-size: 10px; }
