/* index.css - Ultra Minimal Mobile UI System */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --bg-dark: #060911;
  --panel-bg: rgba(11, 15, 26, 0.88);
  --panel-border: rgba(255, 255, 255, 0.12);
  --glass-glow: rgba(249, 115, 22, 0.25);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --sunset-orange: #f97316;
  --sunrise-gold: #f59e0b;
  --sun-yellow: #fbbf24;

  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 10px;

  --shadow-lg: 0 12px 28px -6px rgba(0, 0, 0, 0.7);
  
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  user-select: none;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

/* FULL BLEED MAP */
#map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* TOP BAR - MINIMAL FLOATING */
.top-bar {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.top-bar > * {
  pointer-events: auto;
}

.search-box {
  flex: 1;
  position: relative;
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  padding: 0 12px;
}

.search-box input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  padding: 8px 6px;
}

.search-box input::placeholder {
  color: var(--text-dim);
}

.search-icon {
  color: var(--sunset-orange);
  font-size: 0.95rem;
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--panel-bg);
  backdrop-filter: blur(24px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 200px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
}

.search-results.active {
  display: flex;
}

.search-item {
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--text-main);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.search-item:hover, .search-item:active {
  background: rgba(249, 115, 22, 0.25);
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-lg);
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  font-size: 0.95rem;
}

.btn-gps-large {
  width: 48px;
  height: 48px;
  font-size: 1.4rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(249, 115, 22, 0.5);
  box-shadow: 0 0 16px rgba(249, 115, 22, 0.3), var(--shadow-lg);
}

.btn-icon:active {
  transform: scale(0.95);
  background: rgba(249, 115, 22, 0.3);
}

/* MINIMAL FLOATING BOTTOM BAR */
.minimal-bottom-bar {
  position: absolute;
  bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) + 20px));
  left: 12px;
  right: 12px;
  z-index: 10;
  background: var(--panel-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 440px;
  margin: 0 auto;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.minimal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.minimal-hero {
  display: flex;
  flex-direction: column;
}

.minimal-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--sunset-orange);
  text-transform: uppercase;
}

.minimal-time {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.minimal-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.minimal-bearing {
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.25);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.bearing-val {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--sun-yellow);
}

.bearing-dir {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
}

.btn-toggle {
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.1rem;
  padding: 6px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s, transform 0.2s;
}

.btn-toggle:active {
  transform: scale(0.9);
  opacity: 1;
}

/* EXPANDABLE PANEL (HIDDEN BY DEFAULT) */
.expanded-panel {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.expanded-panel.active {
  display: flex;
}

.scrubber-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scrubber-time-bar {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.scrubber-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  outline: none;
  background: linear-gradient(
    to right,
    #0f172a 0%,
    #3b82f6 20%,
    #f59e0b 38%,
    #f97316 50%,
    #8b5cf6 78%,
    #090d16 100%
  );
  cursor: pointer;
}

.scrubber-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sun-yellow);
  border: 2px solid #ffffff;
  box-shadow: 0 0 8px var(--sunset-orange);
}

.date-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  white-space: nowrap;
  cursor: pointer;
}

.chip-btn.active {
  background: var(--sunset-orange);
  border-color: var(--sunset-orange);
  font-weight: 600;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.metric-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
}

.metric-value {
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* CUSTOM MAP LINE LABELS */
.map-line-label {
  background: rgba(11, 15, 26, 0.88) !important;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 6px !important;
  color: #ffffff !important;
  font-family: var(--font-mono) !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  padding: 2px 6px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
  white-space: nowrap;
}

.map-line-label.sunset {
  border-color: var(--sunset-orange) !important;
  color: #ff9800 !important;
}

.map-line-label.sunrise {
  border-color: var(--sunrise-gold) !important;
  color: #f59e0b !important;
}

.map-line-label.current {
  border-color: var(--sun-yellow) !important;
  color: #fbbf24 !important;
}

.leaflet-tooltip-left::before,
.leaflet-tooltip-right::before,
.leaflet-tooltip-top::before,
.leaflet-tooltip-bottom::before {
  display: none !important;
}

.leaflet-control-zoom,
.leaflet-control-attribution {
  display: none !important;
}
