/* FuelMap v2.0 — Complete CSS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+Devanagari:wght@400;500;600&display=swap');

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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', 'Noto Sans Devanagari', sans-serif;
  background: #0d1117;
  color: #e6edf3;
  font-size: 14px;
}

/* ── TOPBAR ─────────────────────────────────────────────────────────────────── */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: 52px;
  background: #161b22;
  border-bottom: 1px solid #21262d;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; gap: 12px;
}

.topbar-left {
  display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;
}

.logo {
  font-size: 1.2rem; font-weight: 700; cursor: pointer;
  white-space: nowrap; user-select: none; flex-shrink: 0;
}
.logo-fuel { color: #e6edf3; }
.logo-map  { color: #58a6ff; }

/* Search */
.search-wrap {
  flex: 1; max-width: 360px;
  display: flex; align-items: center;
  background: #0d1117; border: 1px solid #30363d; border-radius: 8px;
  transition: border-color .2s;
}
.search-wrap:focus-within { border-color: #58a6ff; box-shadow: 0 0 0 3px rgba(88,166,255,.15); }
.search-icon { width: 16px; height: 16px; color: #7d8590; margin: 0 10px; flex-shrink: 0; }
#search-input {
  flex: 1; background: none; border: none; outline: none;
  color: #e6edf3; font-size: 13px; padding: 9px 0; font-family: inherit;
}
#search-input::placeholder { color: #484f58; }
.search-clear {
  background: none; border: none; color: #7d8590; cursor: pointer;
  padding: 4px 10px; font-size: 13px; transition: color .2s;
}
.search-clear:hover { color: #e6edf3; }
.hidden { display: none !important; }

/* Filter pills */
.topbar-filters {
  display: flex; align-items: center; gap: 5px; flex-shrink: 0;
}

.filter-pill {
  padding: 5px 11px; border-radius: 20px;
  border: 1px solid #30363d; background: transparent;
  color: #7d8590; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all .2s; font-family: inherit;
  white-space: nowrap;
}
.filter-pill:hover { border-color: #58a6ff; color: #58a6ff; }

/* Type filter active states */
.filter-pill[data-type="ALL"].active  { background: #1f6feb; border-color: #1f6feb; color: #fff; }
.filter-pill[data-type="EV"].active   { background: #238636; border-color: #238636; color: #fff; }
.filter-pill[data-type="CNG"].active  { background: #da3633; border-color: #da3633; color: #fff; }
.filter-pill[data-type="BOTH"].active { background: #6e40c9; border-color: #6e40c9; color: #fff; }

/* 24x7 pill */
.pill-247 { border-color: #e3b341; color: #e3b341; }
.pill-247:hover { background: rgba(227,179,65,.15); }
.pill-247.active { background: rgba(227,179,65,.2); border-color: #e3b341; color: #e3b341; font-weight: 700; }

.admin-pill {
  padding: 5px 10px; border-radius: 6px;
  border: 1px solid rgba(88,166,255,.4);
  background: rgba(88,166,255,.1); color: #58a6ff;
  font-size: 12px; cursor: pointer; font-family: inherit; transition: all .2s;
}
.admin-pill:hover { background: rgba(88,166,255,.2); }

.divider-v { width: 1px; height: 20px; background: #21262d; margin: 0 2px; }

/* ── APP BODY ─────────────────────────────────────────────────────────────── */
#app-body {
  display: flex;
  height: calc(100vh - 52px);
  margin-top: 52px;
}

/* ── LEFT PANEL ───────────────────────────────────────────────────────────── */
#left-panel {
  width: 280px; flex-shrink: 0;
  background: #0d1117; border-right: 1px solid #21262d;
  display: flex; flex-direction: column; overflow: hidden;
}

.panel-header {
  padding: 14px 14px 10px;
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-shrink: 0;
}
.panel-title { font-size: 10px; font-weight: 700; color: #7d8590; letter-spacing: 1px; text-transform: uppercase; }
.panel-sub   { font-size: 12px; color: #484f58; margin-top: 3px; }

.locate-btn {
  background: #161b22; border: 1px solid #30363d; border-radius: 8px;
  width: 32px; height: 32px; color: #7d8590; cursor: pointer;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .2s;
}
.locate-btn:hover { border-color: #58a6ff; color: #58a6ff; }

/* Radius slider */
.radius-wrap {
  padding: 0 14px 10px;
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.radius-label { font-size: 11px; color: #7d8590; white-space: nowrap; }
#radius-slider {
  flex: 1; accent-color: #1f6feb; cursor: pointer; height: 4px;
}
.radius-val { font-size: 11px; color: #58a6ff; font-weight: 700; white-space: nowrap; min-width: 36px; text-align: right; }

/* Suggest btn */
.suggest-btn { display: none; }

/* Station list */
#station-list {
  flex: 1; overflow-y: auto; padding: 4px 8px 8px;
}
#station-list::-webkit-scrollbar { width: 3px; }
#station-list::-webkit-scrollbar-thumb { background: #21262d; border-radius: 3px; }

/* Station card */
.station-card {
  padding: 11px 12px; border-radius: 8px;
  border: 1px solid #21262d; margin-bottom: 6px;
  cursor: pointer; background: #0d1117;
  transition: all .2s; position: relative; overflow: hidden;
}
.station-card:hover   { background: #161b22; border-color: #30363d; }
.station-card.active  { border-color: #1f6feb; background: #161b22; box-shadow: 0 0 0 1px rgba(31,111,235,.3); }
.station-card.sponsored::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: #e3b341; border-radius: 3px 0 0 3px;
}

.sc-top { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 5px; }
.sc-name {
  font-size: 13px; font-weight: 600; color: #e6edf3; flex: 1;
  line-height: 1.3; word-break: break-word;
}
.sc-badge {
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px;
  flex-shrink: 0; margin-top: 1px;
}
.sc-badge.CNG  { background: rgba(218,54,51,.2);  color: #f85149; }
.sc-badge.EV   { background: rgba(35,134,54,.2);  color: #3fb950; }
.sc-badge.BOTH { background: rgba(110,64,201,.2); color: #bc8cff; }

.sc-247 {
  font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 3px;
  background: rgba(227,179,65,.15); color: #e3b341; flex-shrink: 0; margin-top: 2px;
}

.sc-addr {
  font-size: 11px; color: #484f58; margin-bottom: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sc-meta { display: flex; align-items: center; justify-content: space-between; }
.sc-left { display: flex; align-items: center; gap: 8px; }
.sc-status { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; }
.sc-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sc-status.active      { color: #3fb950; }
.sc-status.inactive    { color: #f85149; }
.sc-status.maintenance { color: #e3b341; }
.sc-stars { font-size: 11px; color: #e3b341; }
.sc-dist  { font-size: 11px; font-weight: 700; color: #58a6ff; }

/* Source badge */
.src-tag {
  font-size: 9px; padding: 1px 4px; border-radius: 3px; font-weight: 700; margin-left: 3px;
}
.src-tag.google  { background: rgba(79,140,255,.2); color: #79a8f9; }
.src-tag.mappls  { background: rgba(234,67,53,.2);  color: #f78778; }
.src-tag.osm     { background: rgba(35,134,54,.2);  color: #3fb950; }

/* Sidebar footer */
.sidebar-footer {
  padding: 10px 14px; border-top: 1px solid #21262d; flex-shrink: 0;
}
.footer-links { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.footer-links a { font-size: 10px; color: #484f58; text-decoration: none; transition: color .2s; }
.footer-links a:hover { color: #58a6ff; }
.footer-copy { font-size: 10px; color: #30363d; }

/* Empty state */
.empty-state { text-align: center; padding: 40px 20px; color: #484f58; }
.empty-icon  { font-size: 32px; margin-bottom: 10px; }
.empty-text  { font-size: 13px; line-height: 1.6; }
.empty-btn   {
  display: inline-block; margin-top: 14px; padding: 9px 18px;
  background: #1f6feb; color: #fff; border: none; border-radius: 8px;
  font-size: 13px; font-family: inherit; cursor: pointer; transition: background .2s;
}
.empty-btn:hover { background: #388bfd; }

/* ── MAP AREA ─────────────────────────────────────────────────────────────── */
#map-area { flex: 1; position: relative; overflow: hidden; }
#map { width: 100%; height: 100%; background: #0d1117; }

/* Leaflet dark override */
/* NO CSS filter on map tiles - CartoDB dark_all is naturally dark */
.leaflet-tile-pane { filter: none; }
.leaflet-container { background: #1a1a2e; }

.leaflet-control-zoom { display: none; }

/* Map controls */
#map-controls {
  position: absolute; right: 12px; top: 12px; z-index: 401;
  display: flex; flex-direction: column; gap: 4px;
}
#map-controls button {
  width: 32px; height: 32px; background: #161b22;
  border: 1px solid #30363d; border-radius: 6px;
  color: #e6edf3; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
#map-controls button:hover { background: #21262d; border-color: #58a6ff; }

/* Layer switcher */
#layer-switcher {
  position: absolute; right: 12px; top: 130px; z-index: 401;
  display: flex; flex-direction: column; gap: 4px;
}
.layer-btn {
  padding: 5px 10px; border-radius: 6px;
  border: 1px solid #30363d; background: #161b22;
  color: #7d8590; font-size: 10px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all .2s;
  white-space: nowrap; text-align: left;
}
.layer-btn:hover { border-color: #58a6ff; color: #e6edf3; }
.layer-btn.active { background: #1f6feb; border-color: #1f6feb; color: #fff; }

/* Map badge */
#map-badge {
  position: absolute; bottom: 12px; right: 12px; z-index: 400;
  background: rgba(22,27,34,.9); border: 1px solid #21262d;
  border-radius: 6px; padding: 4px 8px; font-size: 10px; color: #484f58;
}

/* Custom markers */
.fm-marker-wrap {
  display: flex; align-items: center; justify-content: center;
}

/* ── DETAIL PANEL ─────────────────────────────────────────────────────────── */
#detail-panel {
  position: fixed; bottom: 0; left: 280px; right: 0; z-index: 500;
  background: #161b22; border-top: 1px solid #21262d;
  border-radius: 16px 16px 0 0;
  max-height: 55vh; overflow-y: auto;
  padding: 20px 24px 24px;
  box-shadow: 0 -8px 32px rgba(0,0,0,.5);
  animation: slideUp .25s ease;
}
#detail-panel.hidden { display: none; }
#detail-panel::-webkit-scrollbar { width: 3px; }
#detail-panel::-webkit-scrollbar-thumb { background: #21262d; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.detail-close {
  position: absolute; top: 14px; right: 14px;
  background: #21262d; border: none; border-radius: 6px;
  width: 28px; height: 28px; color: #7d8590; cursor: pointer;
  font-size: 14px; display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.detail-close:hover { color: #e6edf3; background: #30363d; }

/* Detail badges */
.detail-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.d-badge { padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.d-badge.active  { background: rgba(35,134,54,.15); color: #3fb950; }
.d-badge.inactive { background: rgba(248,81,73,.15); color: #f85149; }
.d-badge.manual  { background: rgba(227,179,65,.15); color: #e3b341; }
.d-badge.sponsored { background: rgba(227,179,65,.15); color: #e3b341; }
.d-badge.source  { background: #21262d; color: #7d8590; }
.d-badge.urjify  { background: rgba(35,134,54,.15); color: #3fb950; }
.d-badge.owner   { background: rgba(188,140,255,.15); color: #bc8cff; }
.d-badge.trusted { background: rgba(88,166,255,.15); color: #79c0ff; }

.detail-name {
  font-size: 1.2rem; font-weight: 700; color: #e6edf3;
  margin-bottom: 6px; padding-right: 40px; line-height: 1.3;
}
.detail-addr { font-size: 13px; color: #7d8590; margin-bottom: 14px; }

/* Photo strip */
.photo-strip {
  display: flex; gap: 8px; overflow-x: auto;
  margin-bottom: 14px; padding-bottom: 4px;
  scrollbar-width: none;
}
.photo-strip::-webkit-scrollbar { display: none; }
.station-photo {
  height: 110px; min-width: 160px; max-width: 200px;
  object-fit: cover; border-radius: 8px; border: 1px solid #21262d;
}

/* Dual rating section */
.rating-section {
  background: #0d1117; border: 1px solid #21262d;
  border-radius: 8px; padding: 10px 14px; margin-bottom: 12px;
}
.rating-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 3px 0;
}
.rating-label { font-size: 11px; color: #484f58; }
.rating-val   { font-size: 14px; font-weight: 700; color: #e3b341; display: flex; align-items: center; gap: 6px; }
.rating-count { font-size: 11px; color: #484f58; font-weight: 400; }

/* Stats row */
.stats-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px; margin-bottom: 12px;
}
.stat-box {
  background: #0d1117; border: 1px solid #21262d; border-radius: 8px;
  padding: 10px 12px; text-align: center;
}
.stat-val       { font-size: 1.1rem; font-weight: 700; margin-bottom: 2px; }
.stat-val.blue  { color: #58a6ff; }
.stat-val.green { color: #3fb950; }
.stat-val.gold  { color: #e3b341; }
.stat-val.purple{ color: #bc8cff; }
.stat-lbl       { font-size: 10px; color: #484f58; }

/* Amenity chips */
.amenity-row { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 12px; }
.amenity-chip {
  padding: 3px 8px; border-radius: 4px; font-size: 11px;
  background: #21262d; color: #7d8590; border: 1px solid #30363d;
}

/* 24x7 badge in detail */
.badge-247 {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 700;
  background: rgba(227,179,65,.15); color: #e3b341; margin-bottom: 10px;
}

/* Action buttons */
.action-row { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }
.btn-navigate {
  flex: 1; min-width: 120px; padding: 11px; border-radius: 8px;
  border: none; background: #1f6feb; color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background .2s; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-navigate:hover { background: #388bfd; }
.btn-review, .btn-verify, .btn-report, .btn-whatsapp {
  padding: 10px 13px; border-radius: 8px;
  border: 1px solid #30363d; background: transparent;
  color: #7d8590; font-size: 13px; font-weight: 500;
  cursor: pointer; font-family: inherit; transition: all .2s; white-space: nowrap;
}
.btn-review:hover   { border-color: #e3b341; color: #e3b341; }
.btn-verify:hover   { border-color: #3fb950; color: #3fb950; }
.btn-report:hover   { border-color: #f85149; color: #f85149; }
.btn-whatsapp:hover { border-color: #25d366; color: #25d366; }

/* Meta footer in detail */
.meta-footer {
  display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: #484f58;
  padding-top: 8px; border-top: 1px solid #21262d; margin-top: 8px;
}
.meta-item { display: flex; align-items: center; gap: 4px; }
.meta-item.warn { color: #e3b341; }
.meta-item a { color: #58a6ff; text-decoration: none; }

/* Reviews */
.reviews-title {
  font-size: 11px; font-weight: 700; color: #7d8590;
  letter-spacing: .6px; text-transform: uppercase; margin-bottom: 10px;
}
.review-item { display: flex; gap: 10px; margin-bottom: 14px; align-items: flex-start; }
.rv-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.rv-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.rv-body { flex: 1; }
.rv-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.rv-name { font-size: 13px; font-weight: 600; color: #e6edf3; }
.rv-stars { font-size: 11px; color: #e3b341; }
.rv-time { font-size: 10px; color: #484f58; margin-left: auto; }
.rv-text { font-size: 12px; color: #7d8590; line-height: 1.5; }
.rv-tag-g {
  font-size: 9px; background: rgba(79,140,255,.2); color: #79a8f9;
  padding: 1px 5px; border-radius: 3px;
}

/* ── MODALS ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: #161b22; border: 1px solid #30363d; border-radius: 12px;
  padding: 24px; width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.modal-title { font-size: 1rem; font-weight: 700; margin-bottom: 16px; color: #e6edf3; }
.modal-input {
  width: 100%; background: #0d1117; border: 1px solid #30363d;
  border-radius: 8px; padding: 9px 12px; color: #e6edf3;
  font-family: inherit; font-size: 13px; outline: none; margin-bottom: 10px;
}
.modal-input:focus { border-color: #1f6feb; }
.modal-input option { background: #161b22; }
.modal-textarea {
  width: 100%; background: #0d1117; border: 1px solid #30363d;
  border-radius: 8px; padding: 9px 12px; color: #e6edf3;
  font-family: inherit; font-size: 13px; outline: none;
  margin-bottom: 10px; resize: vertical; min-height: 80px;
}
.modal-textarea:focus { border-color: #1f6feb; }

.star-select { display: flex; gap: 6px; font-size: 26px; color: #30363d; cursor: pointer; margin-bottom: 12px; }
.star-select span { transition: color .1s; }
.star-select span.active, .star-select span:hover { color: #e3b341; }

.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn-cancel {
  padding: 8px 16px; border-radius: 8px; border: 1px solid #30363d;
  background: transparent; color: #7d8590; font-family: inherit; cursor: pointer; font-size: 13px;
}
.btn-submit {
  padding: 8px 18px; border-radius: 8px; border: none;
  background: #1f6feb; color: #fff; font-family: inherit; cursor: pointer;
  font-size: 13px; font-weight: 600; transition: background .2s;
}
.btn-submit:hover { background: #388bfd; }
.btn-submit:disabled { background: #4a5568; cursor: not-allowed; }

/* ── TOAST ────────────────────────────────────────────────────────────────── */
#toast-area {
  position: fixed; bottom: 20px; right: 20px; z-index: 3000;
  display: flex; flex-direction: column; gap: 6px;
}
.toast {
  background: #161b22; border: 1px solid #30363d; border-radius: 8px;
  padding: 10px 14px; font-size: 12px; color: #e6edf3;
  max-width: 280px; box-shadow: 0 4px 20px rgba(0,0,0,.4);
  animation: toastIn .3s ease;
}
.toast.success { border-left: 3px solid #3fb950; }
.toast.error   { border-left: 3px solid #f85149; }
.toast.info    { border-left: 3px solid #58a6ff; }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── RESPONSIVE ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #left-panel { width: 100%; max-height: 42vh; border-right: none; border-bottom: 1px solid #21262d; }
  #app-body { flex-direction: column; }
  #detail-panel { left: 0; }
  .topbar-filters { display: none; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  #layer-switcher { display: none; }
}
