/* Georgia Ramp Radar — style.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:      #2e7d32;
  --green-dark: #1b5e20;
  --green-light:#e8f5e9;
  --amber:      #f57f17;
  --amber-light:#fff8e1;
  --red:        #c62828;
  --red-light:  #ffebee;
  --gray:       #757575;
  --gray-light: #f5f5f5;
  --border:     #e0e0e0;
  --text:       #212121;
  --radius:     9px;
  --nav-h:      52px;
  --sidebar-w:  320px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: #f9f9f7;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── NAV ── */
nav {
  background: var(--green);
  height: var(--nav-h);
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 300;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.logo { color: #fff; text-decoration: none; font-size: 1.1rem; font-weight: 800; letter-spacing: -0.3px; }
.logo span { color: #a5d6a7; }
nav ul { list-style: none; display: flex; gap: 1.25rem; }
nav ul a { color: #c8e6c9; text-decoration: none; font-size: 0.85rem; font-weight: 500; }
nav ul a:hover { color: #fff; }

/* ── LAYOUT ── */
.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 200;
}

.sidebar-header {
  padding: 0.85rem 1rem 0.6rem;
  border-bottom: 1px solid var(--border);
  background: var(--green-light);
}
.sidebar-header h1 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 0.5rem;
}

/* Search box */
.search-box {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.search-box input {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  outline: none;
}
.search-box input:focus { border-color: var(--green); }
.search-box button {
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}
.search-box button:hover { background: var(--green-dark); }

/* Status bar */
.status-bar {
  font-size: 0.76rem;
  color: var(--gray);
  padding: 0.1rem 0;
}

/* Filters */
.filters {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}
.filter-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}
.filter-row:last-child { margin-bottom: 0; }
.filter-label { font-size: 0.72rem; color: var(--gray); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; width: 100%; margin-bottom: 0.2rem; }
.chip {
  border: 1px solid var(--border);
  background: #fff;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.76rem;
  cursor: pointer;
  color: var(--text);
  transition: all 0.12s;
  white-space: nowrap;
}
.chip.active, .chip:hover { background: var(--green); color: #fff; border-color: var(--green); }
.chip.amber.active { background: var(--amber); border-color: var(--amber); }
.chip.red.active   { background: var(--red);   border-color: var(--red);   }

/* Legend */
.legend {
  display: flex;
  gap: 0.75rem;
  padding: 0.45rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  background: #fafafa;
  flex-wrap: wrap;
}
.legend-item { display: flex; align-items: center; gap: 0.3rem; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-green  { background: #43a047; }
.dot-amber  { background: #fb8c00; }
.dot-red    { background: #e53935; }
.dot-gray   { background: #9e9e9e; }

/* Ramp list */
.ramp-list {
  flex: 1;
  overflow-y: auto;
}
.ramp-item {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.ramp-item:hover, .ramp-item.active { background: var(--green-light); }
.ramp-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.ramp-info { flex: 1; min-width: 0; }
.ramp-name { font-size: 0.88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ramp-meta { font-size: 0.75rem; color: var(--gray); margin-top: 0.1rem; }
.ramp-tags { display: flex; gap: 0.3rem; margin-top: 0.25rem; flex-wrap: wrap; }
.tag {
  background: var(--gray-light);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.68rem;
  color: var(--gray);
}

.no-results { padding: 1.5rem 1rem; text-align: center; color: var(--gray); font-size: 0.88rem; }

/* ── MAP ── */
#map {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* ── DETAIL PANEL ── */
.detail-panel {
  position: absolute;
  bottom: 0;
  left: var(--sidebar-w);
  right: 0;
  background: #fff;
  border-top: 2px solid var(--green);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
  z-index: 250;
  max-height: 52vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}
.detail-panel.open { transform: translateY(0); }
.detail-close {
  position: absolute;
  top: 0.6rem; right: 0.75rem;
  background: none; border: none;
  font-size: 1.3rem; cursor: pointer;
  color: var(--gray); line-height: 1;
}
.detail-inner { padding: 1rem 1.25rem 1.25rem; }
.detail-header { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.85rem; padding-right: 2rem; }
.detail-status-dot { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.detail-name { font-size: 1.1rem; font-weight: 700; }
.detail-subtitle { font-size: 0.82rem; color: var(--gray); margin-top: 0.2rem; }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.detail-stat { background: var(--gray-light); border-radius: 7px; padding: 0.55rem 0.75rem; }
.detail-stat-label { font-size: 0.7rem; color: var(--gray); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.detail-stat-value { font-size: 0.9rem; font-weight: 600; margin-top: 0.15rem; }
.detail-condition {
  padding: 0.6rem 0.85rem;
  border-radius: 7px;
  font-size: 0.85rem;
  margin-bottom: 0.85rem;
  font-weight: 600;
}
.cond-green { background: var(--green-light); color: var(--green-dark); }
.cond-amber { background: var(--amber-light); color: #e65100; }
.cond-red   { background: var(--red-light);   color: var(--red); }
.cond-gray  { background: var(--gray-light);  color: var(--gray); }
.detail-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.action-btn {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.action-btn:hover { opacity: 0.85; }
.btn-maps     { background: #1a73e8; color: #fff; }
.btn-forecast { background: var(--green); color: #fff; }
.btn-gauge    { background: #546e7a; color: #fff; }

/* ── LOADING ── */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  font-size: 0.95rem;
  color: var(--green-dark);
  flex-direction: column;
  gap: 0.75rem;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--green-light);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RADIUS CONTROL ── */
.radius-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.76rem;
  color: var(--gray);
  margin-top: 0.35rem;
}
.radius-row label { white-space: nowrap; }
.radius-row select {
  flex: 1;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.76rem;
  background: #fff;
  cursor: pointer;
}
.radius-row select:focus { outline: none; border-color: var(--green); }

/* ── MOBILE ── */
@media (max-width: 680px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .detail-panel { left: 0; }
  .mobile-fab {
    display: flex;
    position: absolute;
    bottom: 5rem;
    left: 1rem;
    z-index: 300;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 28px;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(0,0,0,0.25);
    gap: 0.4rem;
    align-items: center;
  }
}
@media (min-width: 681px) {
  .mobile-fab { display: none; }
}
