/* ============================================================
   Georgia Gas Stations - Main Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500;600&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --bg-deep:       #0d0f14;
  --bg-panel:      #13161e;
  --bg-card:       #1a1e2a;
  --bg-hover:      #222839;
  --accent:        #f5a623;
  --accent-glow:   rgba(245,166,35,0.25);
  --accent-soft:   rgba(245,166,35,0.12);
  --green:         #2ecc71;
  --red:           #e74c3c;
  --text-primary:  #edf0f7;
  --text-secondary:#8890a8;
  --text-muted:    #545c74;
  --border:        rgba(255,255,255,0.06);
  --border-hover:  rgba(245,166,35,0.3);
  --shadow:        0 8px 32px rgba(0,0,0,0.5);
  --radius:        12px;
  --sidebar-w:     300px;
  --panel-w:       360px;
  --topbar-h:      60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  overflow: hidden;
}

/* ── Layout ───────────────────────────────────── */
#app {
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
}

/* ── Topbar ───────────────────────────────────── */
#topbar {
  grid-column: 1 / -1;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: relative;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.topbar-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.topbar-logo .logo-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--text-primary);
  line-height: 1;
}

.topbar-logo .logo-sub {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 3px;
  text-transform: uppercase;
}

.topbar-divider {
  width: 1px; height: 30px;
  background: var(--border);
  flex-shrink: 0;
}

.search-wrap {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.search-wrap input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 16px 9px 40px;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}
.search-wrap input::placeholder { color: var(--text-muted); }
.search-wrap input:focus { border-color: var(--accent); }

.search-wrap .search-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 14px; pointer-events: none;
}

.topbar-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 12px;
}

.btn-locate {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: opacity .2s, transform .1s;
  white-space: nowrap;
}
.btn-locate:hover { opacity: .9; transform: translateY(-1px); }
.btn-locate:active { transform: translateY(0); }

.status-pill {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity:1; }
  50% { opacity:.4; }
}

/* ── Sidebar ───────────────────────────────────── */
#sidebar {
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 50;
}

.sidebar-section {
  padding: 16px 16px 0;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Fuel type filter */
.fuel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.fuel-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.fuel-chip:hover, .fuel-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* Company filter list */
.company-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px;
}
.company-list::-webkit-scrollbar { width: 4px; }
.company-list::-webkit-scrollbar-track { background: transparent; }
.company-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.company-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .2s;
  margin-bottom: 4px;
  border: 1px solid transparent;
  position: relative;
}
.company-item:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}
.company-item.active {
  background: var(--accent-soft);
  border-color: var(--border-hover);
}

.company-logo {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 13px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg-card);
}
.company-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }

.company-info { flex: 1; min-width: 0; }
.company-name { font-weight: 600; font-size: 14px; }
.company-count {
  font-size: 11px; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.company-check {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
  flex-shrink: 0;
}
.company-item.active .company-check {
  background: var(--accent);
  border-color: var(--accent);
}
.company-check svg { display: none; }
.company-item.active .company-check svg { display: block; }

/* Station count summary */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-deep);
}

.stats-row {
  display: flex; gap: 8px;
}

.stat-box {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}
.stat-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  color: var(--accent);
  line-height: 1;
}
.stat-lbl {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ── Map ───────────────────────────────────── */
#map-container {
  position: relative;
  overflow: hidden;
}

#map {
  width: 100%; height: 100%;
}

/* Map controls overlay */
.map-overlay {
  position: absolute;
  top: 16px; right: 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 10;
}

.map-btn {
  width: 40px; height: 40px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 16px;
  transition: all .2s;
  backdrop-filter: blur(10px);
}
.map-btn:hover { background: var(--bg-hover); color: var(--accent); border-color: var(--border-hover); }

/* ── Station Info Panel ───────────────────────── */
#info-panel {
  position: absolute;
  bottom: 0; right: 0;
  width: var(--panel-w);
  max-height: calc(100% - 30px);
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  border-radius: 16px 0 0 0;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  z-index: 30;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow);
}
#info-panel.open { transform: translateX(0); }

.panel-header {
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-brand {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.panel-logo {
  width: 48px; height: 48px;
  border-radius: 10px;
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.panel-logo img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }

.panel-company { font-family: 'Bebas Neue', sans-serif; font-size: 20px; letter-spacing: 1px; }
.panel-address { font-size: 12px; color: var(--text-secondary); margin-top: 2px; line-height: 1.4; }

.panel-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 30px; height: 30px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  transition: all .2s;
}
.panel-close:hover { color: var(--text-primary); border-color: var(--border-hover); }

.distance-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

/* Prices */
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.panel-body::-webkit-scrollbar { width: 4px; }
.panel-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.prices-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.price-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.price-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  transition: border-color .2s;
}
.price-card:hover { border-color: var(--border-hover); }

.price-type {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.price-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  color: var(--accent);
  line-height: 1;
}
.price-unit {
  font-size: 11px;
  color: var(--text-secondary);
}
.price-octane {
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 2px;
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.panel-footer {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.btn-directions {
  width: 100%;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity .2s;
}
.btn-directions:hover { opacity: .85; }

.prices-source {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}
.prices-source a { color: var(--accent); text-decoration: none; }

/* ── Loading overlay ───────────────────────────── */
#loading-overlay {
  position: fixed; inset: 0;
  background: var(--bg-deep);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
  z-index: 9999;
  transition: opacity .5s;
}
#loading-overlay.hidden { opacity: 0; pointer-events: none; }

.loader-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 48px;
  letter-spacing: 4px;
  color: var(--accent);
}
.loader-sub {
  font-size: 12px; letter-spacing: 3px;
  text-transform: uppercase; color: var(--text-muted);
}
.loader-bar {
  width: 200px; height: 3px;
  background: var(--bg-card);
  border-radius: 2px;
  overflow: hidden;
}
.loader-progress {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  animation: load 2s ease-out forwards;
}
@keyframes load { from { width:0; } to { width:100%; } }

/* ── Custom map marker styles ─────────────────── */
.custom-marker {
  cursor: pointer;
}

/* ── Toast notifications ──────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 9999;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow);
  animation: toastIn .3s ease;
  backdrop-filter: blur(10px);
  white-space: nowrap;
}
@keyframes toastIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }

/* ── Mobile responsive ──────────────────────── */
@media (max-width: 768px) {
  :root {
    --sidebar-w: 100%;
    --panel-w: 100%;
  }

  #app {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-h) 1fr;
    position: relative;
  }

  #sidebar {
    position: fixed;
    left: 0; top: var(--topbar-h);
    bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform .3s ease;
    z-index: 200;
    border-right: 1px solid var(--border);
  }
  #sidebar.open { transform: translateX(0); }

  #map-container {
    grid-column: 1;
  }

  #info-panel {
    width: 100%;
    border-radius: 16px 16px 0 0;
    border-left: none;
    border-top: 1px solid var(--border);
    max-height: 70vh;
  }

  .sidebar-toggle-mob {
    display: flex !important;
  }

  .search-wrap { max-width: 200px; }

  .sidebar-backdrop {
    display: block !important;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
  }
  .sidebar-backdrop.active { opacity: 1; pointer-events: all; }
}

.sidebar-toggle-mob {
  display: none;
  width: 36px; height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-secondary);
  font-size: 16px;
}

/* ── Cluster marker override ──────────────────── */
.cluster-marker {
  background: var(--accent) !important;
  color: #000 !important;
  border-radius: 50% !important;
  font-family: 'Bebas Neue', sans-serif !important;
  font-size: 16px !important;
  border: 3px solid rgba(245,166,35,0.3) !important;
  box-shadow: 0 0 0 6px rgba(245,166,35,0.1) !important;
}

/* Google Maps custom styles applied via JS */
.gm-style .gm-style-iw-c {
  background: var(--bg-panel) !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow) !important;
}

/* ── No results ──────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 13px; line-height: 1.6; }
