/* ==========================================================================
   VortexFuel — Light Theme & Universal Fuel Color Coding
   ========================================================================== */

* {
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: #f8fafc;
  color: #0f172a;
}

/* Header & Subheader Layout */
.app-header {
  height: 56px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  position: relative;
  z-index: 30;
}

.sub-header {
  height: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  position: relative;
  z-index: 25;
}

/* Main Workspace */
.main-workspace {
  display: flex;
  height: 700px;
  min-height: 550px;
  position: relative;
  overflow: hidden;
  background-color: #f1f5f9;
}

.map-wrapper {
  flex: 1;
  height: 100%;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
}

/* Side Panel (Right Docked on Desktop) */
.side-panel {
  width: 430px;
  height: 100%;
  background-color: #ffffff;
  border-left: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  z-index: 20;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.05);
}

@media (max-width: 1023px) {
  .side-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 460px;
    transform: translateX(100%);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.2);
  }
  .side-panel.open {
    transform: translateX(0);
  }
}

/* Navigation Tabs */
.nav-btn {
  cursor: pointer;
  border: 1px solid transparent;
}
.nav-btn.active {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Fuel Type Chips with Universal Colors */
.fuel-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  background: #ffffff;
  color: #475569;
  border: 1px solid #cbd5e1;
  transition: all 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}

.fuel-chip:hover {
  border-color: #94a3b8;
  color: #0f172a;
}

/* Active states honoring universal colors */
.fuel-chip.active.chip-benzina {
  background: #f0fdf4;
  color: #15803d;
  border-color: #86efac;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.2);
}

.fuel-chip.active.chip-gasolio {
  background: #f8fafc;
  color: #0f172a;
  border-color: #475569;
  box-shadow: 0 0 12px rgba(15, 23, 42, 0.15);
}

.fuel-chip.active.chip-gpl {
  background: #f0f9ff;
  color: #0369a1;
  border-color: #7dd3fc;
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.2);
}

.fuel-chip.active.chip-metano {
  background: #fffbeb;
  color: #b45309;
  border-color: #fcd34d;
  box-shadow: 0 0 12px rgba(217, 119, 6, 0.2);
}

/* Station Cards */
.station-card {
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.station-card:hover {
  transform: translateY(-2px);
  border-color: #94a3b8;
  background: #ffffff;
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.08);
}

/* Universal Fuel Color Badges for Prices */
.price-badge-benzina {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.price-badge-gasolio {
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

.price-badge-gpl {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
}

.price-badge-metano {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}

/* Map Markers (High-contrast, crisp pills) */
.fuel-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.15s ease;
  user-select: none;
  font-family: 'Space Grotesk', monospace;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.fuel-marker:hover {
  transform: scale(1.2);
  z-index: 100;
}

.marker-benzina {
  background: #16a34a;
  color: #ffffff;
  border: 1px solid #15803d;
}

.marker-gasolio {
  background: #1e293b;
  color: #ffffff;
  border: 1px solid #0f172a;
}

.marker-gpl {
  background: #0284c7;
  color: #ffffff;
  border: 1px solid #0369a1;
}

.marker-metano {
  background: #d97706;
  color: #ffffff;
  border: 1px solid #b45309;
}

/* City Summary Pin when zoomed out */
.city-cluster-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 10px;
  background: #ffffff;
  color: #0f172a;
  border: 2px solid #0f172a;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.2s ease;
}

.city-cluster-marker:hover {
  transform: scale(1.1);
  border-color: #16a34a;
}

/* MapLibre Popups (Light theme) */
.maplibregl-popup-content {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  padding: 14px !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12) !important;
}

.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
  border-top-color: #ffffff !important;
}
.maplibregl-popup-close-button {
  color: #64748b !important;
  font-size: 16px !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

/* ==========================================================================
   Top Dual Fuel Hero Flip-Board Clusters (Image 5 Reproduction)
   ========================================================================== */
.hero-cluster-card {
  position: relative;
  background: #000000 !important;
  border-radius: 0.95rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-cluster-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.8);
}

.hero-cluster-card.active-cluster {
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4), 0 10px 30px rgba(0, 0, 0, 0.85);
}

#hero-cluster-gasolio.active-cluster {
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.4), 0 10px 30px rgba(0, 0, 0, 0.85);
}

/* Digital Board Tiles (Mechanical Flip Card Style on Pure Black) */
.digital-tile {
  width: 36px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #18181b 0%, #09090b 100%);
  border: 1px solid #27272a;
  border-radius: 6px;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.9), 0 2px 4px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

@media (min-width: 640px) {
  .digital-tile {
    width: 46px;
    height: 60px;
  }
}

/* Split line across the middle of digital tile */
.digital-tile::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #000000;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.digit-val {
  font-family: 'Space Grotesk', 'Courier New', monospace;
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1;
}

@media (min-width: 640px) {
  .digit-val {
    font-size: 2.45rem;
  }
}

#hero-cluster-benzina .digit-val {
  color: #22c55e; /* Electric Green */
  text-shadow: 0 0 12px rgba(34, 197, 94, 0.75), 0 0 24px rgba(34, 197, 94, 0.35);
}

#hero-cluster-gasolio .digit-val {
  color: #fbbf24; /* Radiant Amber / Gold */
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.75), 0 0 24px rgba(251, 191, 36, 0.35);
}

/* European Countries Comparison Modal Animations */
#countries-modal:not(.hidden) {
  display: flex;
}

#countries-modal.hidden {
  display: none;
}

/* Checkerboard Square Variations ("Cuadros de Ajedrez") */
.chess-tile-white {
  background-color: #ffffff;
  border-color: #e2e8f0;
}
.chess-tile-slate {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}
.chess-tile-slate:hover {
  background-color: #ffffff;
}

/* Universal Fuel Color Utilities */
.border-fuel-benzina { border-color: #16a34a; }
.text-fuel-benzina { color: #16a34a; }
.bg-fuel-benzina { background-color: #16a34a; }

.border-fuel-gasolio { border-color: #1e293b; }
.text-fuel-gasolio { color: #1e293b; }
.bg-fuel-gasolio { background-color: #1e293b; }

.border-fuel-gpl { border-color: #0284c7; }
.text-fuel-gpl { color: #0284c7; }
.bg-fuel-gpl { background-color: #0284c7; }

.border-fuel-metano { border-color: #d97706; }
.text-fuel-metano { color: #d97706; }
.bg-fuel-metano { background-color: #d97706; }

