/* =======================
   BASE / RESET
   ======================= */

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f4f6fa;
  color: #253041;
  margin: 0;
}

header {
  text-align: center;
  font-size: 2rem;
  color: #1178c3;
  margin: 14px 0 8px;
  font-weight: 700;
}


/* =======================
   BOUTONS GENERIQUES
   ======================= */

.btn {
  display: flex;
  align-items: center;
  font-size: 1rem;
  padding: 6px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background .17s, color .17s, border .16s;
  box-shadow: 0 1px 7px #0001;
  border: 1.5px solid #1178c3;
  background: #eaf5fa;
  color: #1178c3;
  gap: 7px;
}

.btn:hover {
  background: #1178c3;
  color: #fff;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Variante "success" (sync actif, etc.) */
.btn-success {
  background: #d2fbe4;
  color: #0f8c43;
  border-color: #0f8c43;
}


/* =======================
   BARRE DE FILTRES PRINCIPALE
   ======================= */

#filtre-container {
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  align-items: center;
  justify-content: center;
  background: #fff;
  box-shadow: 0 2px 20px #5ca0f1;
  padding: 12px 14px 10px 14px;
  overflow-x: auto;
}

#filtre-container select {
  max-width: 160px;
}

.filtre-label {
  display: flex;
  align-items: center;
  font-size: 1rem;
  position: relative;
}

.filtre-label select,
.filtre-label input[type="text"] {
  margin-left: 7px;
  border: 1px solid #c9d6e1;
  background: #fafdff;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 1rem;
  min-width: 90px;
  outline: none;
  transition: border-color 0.18s;
}

.reset-cross {
  margin-left: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.reset-cross svg {
  width: 14px;
  height: 14px;
}


/* =======================
   CARBURANTS (pills)
   ======================= */

.filtre-carburants-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
  margin-left: 7px;
}

.fuel-btn {
  display: flex;
  align-items: center;
  font-weight: bold;
  font-size: 1.18em;
  padding: 7px 23px 7px 14px;
  border-radius: 100px;
  background: #1586d5;
  color: #fff;
  border: none;
  cursor: pointer;
  outline: none;
  margin-right: 3px;
  transition: background 0.13s, color 0.13s;
  box-shadow: 0 2px 9px #0001;
  position: relative;
}

.fuel-btn .fuel-code {
  font-size: 9px;
  font-weight: 200;
  margin-left: 7px;
}

.fuel-btn.inactive {
  background: #e1e8ef !important;
  color: #3c4b5a !important;
  font-weight: 500;
  border: 1.5px solid #bfd3ea;
}

.fuel-btn:active {
  filter: brightness(0.96);
}

.fuel-btn[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
}


/* =======================
   BOUTON 24/24
   ======================= */

.auto24-btn {
  font-weight: bold;
  font-size: 1.18em;
  border-radius: 100px;
  border: 2px solid #e5e5e5;
  padding: 7px 22px;
  margin-right: 2px;
  background: #fff;
  color: #b93131;
  cursor: pointer;
  box-shadow: 0 2px 8px #0001;
  transition: background .17s, color .17s, border .18s;
}

.auto24-btn.active {
  background: #1cc070;
  color: #fff;
  border-color: #10a450;
}

.auto24-btn.inactive {
  background: #fff;
  color: #b93131;
  border-color: #b93131;
}


/* =======================
   DROPDOWN SERVICES
   ======================= */

.services-list {
  display: none;
  position: fixed !important;
  z-index: 9999 !important;
  left: auto;
  width: 320px;
  background: #fff;
  border: 1.5px solid #c9d6e1;
  border-radius: 8px;
  margin-top: 2px;
  max-height: 340px;
  overflow-y: auto;
  box-shadow: 0 8px 24px #0001;
  font-size: 1.02em;
  top: 130px;
  right: auto;
}

.services-dropdown.open .services-list {
  display: block;
}

.services-list label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px 11px 10px;
  cursor: pointer;
  border-bottom: 1px solid #f0f4fa;
  background: #fff;
}

.services-list label:last-child {
  border-bottom: none;
}

.services-list label:hover {
  background: #e5f0fa;
}

.services-btn {
  border: 1px solid #c9d6e1;
  background: #fafdff;
  border-radius: 7px;
  padding: 7px 19px 7px 9px;
  min-width: 190px;
  font-size: 1rem;
  cursor: pointer;
  text-align: left;
  font-weight: 600;
}

.services-btn:after {
  content: "▼";
  float: right;
  font-size: .9em;
  color: #888;
  margin-left: 9px;
}

.services-btn.active {
  background: #e7f4ff;
  border-color: #1178c3;
  color: #1178c3;
}


/* =======================
   LIGNE D'ACTIONS (RECHERCHE / GEO / RESET)
   ======================= */

.filtre-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

#filtre-actions {
  flex-wrap: nowrap;
  gap: 14px;
  margin-top: 14px;
  margin-bottom: 2px;
}

/* Boutons géoloc & reset global */
#geo-btn,
#reset-all {
  background: #eaf5fa;
  color: #1178c3;
  border: 1.5px solid #1178c3;
  border-radius: 8px;
  font-size: 1rem;
  padding: 6px 18px;
  font-weight: 600;
  min-width: 180px;
  cursor: pointer;
  transition: background .17s, color .17s, border .16s;
  box-shadow: 0 1px 7px #0001;
  display: flex;
  align-items: center;
  gap: 7px;
}

#geo-btn.active {
  background: #d2fbe4;
  color: #0f8c43;
  border-color: #0f8c43;
}

#geo-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#reset-all {
  background: #fff;
  color: #b93131;
  border: 1.5px solid #b93131;
  min-width: 180px;
  padding: 6px 18px 6px 12px;
}

#reset-all .reset-icon {
  font-size: 1.15em;
  color: #b93131;
  font-weight: bold;
  margin-right: 4px;
  display: inline-block;
  vertical-align: middle;
}

#reset-all:hover {
  background: #b93131;
  color: #fff;
  border-color: #b93131;
}

#reset-all:hover .reset-icon {
  color: #fff;
}


/* =======================
   BOUTON D'ACTION (LOUPE)
   ======================= */

.action-btn {
  background: #eaf5fa;
  color: #1178c3;
  border: 1.5px solid #1178c3;
  border-radius: 8px;
  font-size: 1rem;
  padding: 6px 18px;
  font-weight: 600;
  min-width: 62px;
  cursor: pointer;
  transition: background .17s, color .17s;
  box-shadow: 0 1px 7px #0001;
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-btn:hover {
  background: #1178c3;
  color: #fff;
}

.action-btn svg {
  margin-right: 7px;
}


/* =======================
   SEARCH / RECHERCHE
   ======================= */

.search-zone {
  display: flex;
  align-items: center;
  position: relative;
  min-width: 38px;
}

.search-zone .search-input {
  width: 0;
  opacity: 0;
  transition: width 0.22s cubic-bezier(.65,.03,.35,1), opacity 0.2s;
  border: 1.5px solid #1178c3;
  border-radius: 7px;
  padding: 6px 0 6px 12px;
  font-size: 1rem;
  margin-left: -8px;
  background: #fafdff;
  outline: none;
  position: relative;
  z-index: 2;
}

.search-zone.active .search-input {
  width: 138px;
  opacity: 1;
  margin-left: 7px;
}

.search-zone .search-reset {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 38px;
  z-index: 3;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px;
  display: none;
}

.search-zone.active .search-reset {
  display: block;
  left: calc(7px + 210px - 24px); /* largeur input, largeur croix */
}


/* =======================
   MAP / FULLSCREEN
   ======================= */

#map-container {
  width: 96vw;
  max-width: 96vw;
  margin: 16px auto 0 auto;
  border-radius: 16px;
  box-shadow: 0 2px 20px #00408b12;
  transition: width .23s cubic-bezier(.44,.13,.38,1), max-width .23s cubic-bezier(.44,.13,.38,1);
  position: relative;
  height: 460px;
  background: #eaf5fa;
}

/* Plein écran MAP */
#map-container.fullscreen {
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  border-radius: 0 !important;
  z-index: 10001 !important;
  box-shadow: none !important;
  background: #eaf5fa;
}

body.map-fullscreen,
html.map-fullscreen {
  overflow: hidden !important;
}

/* Carte pleine largeur (sans sortir du flux) */
#map-container.fullwidth {
  width: 100vw !important;
  max-width: 100vw !important;
  left: 0 !important;
  top: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  z-index: 5000 !important;
  background: #eaf5fa;
}

#map {
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

#map-fullscreen-btn,
#map-center-btn,
#map-width-btn {
  position: absolute;
  top: 16px;
  z-index: 1001;
  background: #fff;
  border-radius: 7px;
  border: 1.5px solid #1178c3;
  color: #1178c3;
  font-size: 1em;
  cursor: pointer;
  box-shadow: 0 2px 8px #0001;
  transition: background .17s, color .17s;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
}

/* Plein écran : bouton à gauche */
#map-fullscreen-btn {
  right: 140px;
  min-width: 120px;
}

/* Bouton largeur max */
#map-width-btn {
  right: 80px;
  min-width: 44px;
  max-width: 44px;
  font-size: 1.23em;
  padding: 0;
  margin-right: 4px;
}

/* Bouton recentrer (à droite) */
#map-center-btn {
  right: 24px;
  min-width: 44px;
  max-width: 44px;
  font-size: 1.35em;
  justify-content: center;
}

#map-fullscreen-btn:hover,
#map-center-btn:hover,
#map-width-btn:hover {
  background: #1178c3;
  color: #fff;
}

/* Tooltip Leaflet custom (si utilisé) */
.leaflet-tooltip.carb-marker-tooltip {
  font-weight: 600;
  color: #00304e;
  background: #fff !important;
  border: 1.5px solid #1793d3 !important;
  box-shadow: 0 4px 14px #0002 !important;
  border-radius: 10px !important;
  padding: 8px 18px !important;
}


/* =======================
   TABLEAU
   ======================= */

#prixcarburants-table {
  margin: 0 !important;
  padding: 0 !important;
  border: none;
  width: 100%;
  max-width: 100%;
  background: none !important;
  box-shadow: none !important;
  margin-top: 10px;
  transition: opacity 0.38s cubic-bezier(.44,.13,.38,1);
}

#prixcarburants-table .table-scroll {
  overflow-x: auto;
  max-width: 100vw;
  border-radius: 13px;
}

#prixcarburants-table table {
  width: 100%;
  background: #fff;
  margin-top: 3px;
  border-radius: 12px;
  overflow: hidden;
  border-collapse: collapse;
  box-shadow: 0 1px 10px #0001;
}

#prixcarburants-table th,
#prixcarburants-table td {
  padding: 7px 11px;
  font-size: 14px;
  border-bottom: 1px solid #edf1f5;
  text-align: left;
  vertical-align: middle;
}

#prixcarburants-table th {
  background: #f0f6fb;
  color: #fb7401;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

#prixcarburants-table th.sortable:hover {
  background: #e0edfa;
  color: #025cb6;
}

#prixcarburants-table th.th-center,
#prixcarburants-table th[data-center] {
  text-align: center !important;
}

#prixcarburants-table tr:hover td {
  background: #e6f1fa;
}

/* état "en cours de filtrage" */
#prixcarburants-table.fading {
  opacity: .55;
  pointer-events: none;
  transition: opacity .22s ease;
}

/* Liens & cellules cliquables */
.station-link {
  color: #1178c3;
  text-decoration: underline;
  font-weight: 600;
  cursor: pointer;
}

.text-cell.clickable {
  cursor: pointer;
  color: #1a202c;
  border-radius: 4px;
  transition: background .11s;
  padding: 1px 2px;
}

.text-cell.clickable:hover,
.text-cell.clickable.active {
  background: #eaf5fa;
  color: #1178c3;
  font-weight: 600;
}


/* =======================
   BANDEAU RÉSUMÉ / CHIPS
   ======================= */

.stations-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #1586d5 0%, #25d4f7 100%);
  color: #fff;
  padding: 14px 0 10px 0;
  margin: 3px 0 0 0;
  box-shadow: 0 2px 12px #1586d511, 0 1px 0 #fff1 inset;
  border-radius: 0;
  width: 100%;
  min-width: 100%;
  position: relative;
}

.stations-banner-none {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #ff8800 0%, #ffc34d 100%);
  color: #fff;
  padding: 14px 0 10px 0;
  margin: 3px 0 0 0;
  box-shadow: 0 2px 12px #1586d511, 0 1px 0 #fff1 inset;
  border-radius: 0;
  width: 100%;
  min-width: 100%;
  position: relative;
}

.stations-emoji {
  font-size: 1.8em;
  filter: drop-shadow(0 2px 3px #1071b570);
}

.stations-count {
  font-size: 1.22em;
  font-weight: 700;
  margin-top: 2px;
  margin-bottom: 0;
  margin-right: 4px;
  letter-spacing: .05em;
}

.stations-number {
  font-size: 1.32em;
  font-weight: 800;
}

.no-result-tip {
  display: block;
  margin-top: 6px;
  font-size: 1em;
  color: #000;
  background: rgba(255, 255, 255, 0.30);
  border-radius: 7px;
  padding: 4px 8px;
  font-weight: 500;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 4px #ff880015;
}

/* Résumé des filtres (chips) */
.filter-summary-inline {
  margin-top: 8px;
  font-size: 1.08em;
  color: #e6f1fa;
  background: rgba(255,255,255,0.13);
  font-weight: 500;
  border-radius: 7px;
  padding: 4px 17px;
  box-shadow: 0 2px 10px #225a8c09;
  min-height: 23px;
  max-width: 94vw;
  text-align: center;
  opacity: 0.95;
  pointer-events: auto;      /* chips cliquables */
  transition: background 0.25s;
  display: block;
  line-height: 1.5;
}

.filter-summary-inline strong {
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Chips */
.chip {
  display:inline-flex;
  align-items:center;
  gap:.5rem;
  background:#e8f3ff;
  border:1px solid #a9d7fb;
  color:#0e5aa3;
  padding:.32rem .65rem;
  border-radius:999px;
  font-size:.98em;
  line-height:1;
  cursor:pointer;
  box-shadow:0 2px 6px rgba(0,0,0,.06);
  user-select:none;
  white-space:nowrap;
}

.chip:hover {
  background:#dff0ff;
  border-color:#8ec9fb;
}

.chip-label {
  font-weight:700;
  color:#0a3770;
  opacity:.9;
}

.chip-value {
  font-weight:800;
  color:#fb7401;
  background:#ffffff;
  border:1px solid #cde6ff;
  padding:.08rem .45rem;
  border-radius:999px;
}

.chip-x {
  font-weight:900;
  color:#e70000;
  opacity:.85;
}

.chip-x:hover {
  opacity:1;
  transform:scale(1.20);
}

.chip--fuels {
  background:#eff9ff;
  border-color:#bfe6ff;
}

.chip--search {
  background:#fff5e6;
  border-color:#ffd699;
  color:#7a4b00;
}

.chip--geoloc {
  background:#e9fff0;
  border-color:#b5efc9;
  color:#0f6a3b;
}

/* Accessibilité : focus visible (complété par JS inline si besoin) */
.chip:focus {
  outline: 3px solid #82c5ff;
  outline-offset: 2px;
}


/* =======================
   SERVICES (ICÔNES + TOOLTIP)
   ======================= */

.service-ic {
  width: 22px;
  height: 22px;
  display: inline-block;
  margin-right: 2px;
  vertical-align: middle;
  cursor: pointer;
  position: relative;
}

.service-ic.clickable {
  cursor:pointer;
}

.service-ic.clickable:hover {
  transform:scale(1.12);
}

.service-tooltip {
  position: fixed;
  background: #222;
  color: #fff;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 14px;
  white-space: nowrap;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: opacity .10s;
  box-shadow: 0 1px 10px #0005;
}


/* =======================
   LOADER
   ======================= */

#loader-stations {
  margin: 16px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}


/* =======================
   PAGINATION
   ======================= */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 12px;
  gap: 3px;
}

.pagination button {
  margin: 0 2px;
  padding: 4px 11px;
  border-radius: 5px;
  background: #e4eef8;
  border: 1px solid #b6cbe0;
  color: #246;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: .15s;
}

.pagination button.selected,
.pagination button:hover {
  background: #1178c3;
  color: #fff;
  border-color: #1178c3;
}

.pagination .pag-arrow {
  font-size: 1.12em;
  padding: 4px 13px;
  font-weight: bold;
}

.pagination button:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}


/* =======================
   FOOTER BANDEAU
   ======================= */

#footer-bandeau {
  width: 100%;
  min-width: 100%;
  background: linear-gradient(360deg, #000152 54% 58%, #0079ff);
  color: #fff;
  font-size: 1.08em;
  text-align: center;
  padding: 22px 0 18px 0;
  letter-spacing: 0.05em;
  font-weight: 500;
  box-shadow: 0 -1px 8px #00355522;
  position: relative;
  z-index: 200;
  border-top: 1px solid #333333;
}

#footer-bandeau strong {
  color: #ffe25a;
  font-weight: 700;
  letter-spacing: 0.07em;
}

#footer-bandeau .footer-links a {
  color: #c5efff;
  text-decoration: underline;
  margin: 0 7px;
  font-size: 1em;
  transition: color 0.18s;
}

#footer-bandeau .footer-links a:hover {
  color: #fe7d00;
}


/* =======================
   RESPONSIVE
   ======================= */

@media (max-width: 950px) {
  #filtre-container {
    flex-wrap: wrap;
    flex-direction: column;
    align-items: stretch;
    overflow-x: visible;
  }
  .filtre-label select,
  .services-btn,
  #search-zone .search-input {
    max-width: 140px;
    min-width: 70px;
  }
  #search-zone {
    flex-shrink: 0;
    min-width: 140px;
  }
}

@media (max-width: 900px) {
  .filtre-row {
    flex-wrap: wrap;
    gap: 7px;
  }
  #filtre-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
}

@media (max-width: 700px) {
  #prixcarburants-table th,
  #prixcarburants-table td {
    font-size: 12px;
  }
  #map {
    height: 200px;
  }
  #map-container {
    height: 220px;
  }
  #reset-all {
    min-width: 100px;
    padding: 6px 6px;
  }
  .services-list {
    width: 96vw;
  }
  #geo-btn,
  #reset-all {
    min-width: 110px;
    font-size: 0.97em;
  }
  .search-zone.active .search-input {
    width: 120px;
  }
  .search-zone.active .search-reset {
    left: calc(7px + 120px - 24px);
  }
}

@media (max-width: 600px) {
  #map-fullscreen-btn {
    top: 16px;
    right: 12px;
    min-width: 105px;
    font-size: 0.97em;
  }
  #map-width-btn {
    top: 66px;
    right: 12px;
    min-width: 44px;
    max-width: 44px;
    font-size: 1.2em;
  }
  #map-center-btn {
    top: 116px;
    right: 12px;
    min-width: 44px;
    max-width: 44px;
    font-size: 1.35em;
  }
}

@media (max-width: 500px) {
  #filtre-container {
    gap: 7px;
  }
  #reset-all {
    width: 100%;
  }
}


