:root {
  --bg-color: #ffffff;
  --text-color: #1a202c;
  --card-bg: #f7fafc;
  --border-color: #e2e8f0;
  --link-color: #2b6cb0;
  --title-table-color: #9b9ea2;
  --row-hover: #edf2f7;
  --row-hover-dark: #4a5568;
}

[data-theme="dark"] {
  --bg-color: #1a202c;
  --text-color: #edf2f7;
  --card-bg: #2d3748;
  --border-color: #4a5568;
  --link-color: #90cdf4;
  --title-table-color: #404b56;
  --row-hover: #4a5568;
  --row-hover-dark: #2d3748;
}

html, body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  height: 100%;
  margin: 0;
  padding: 0;
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

a {
  color: var(--link-color);
}

* {
  transition: background-color 0.3s, color 0.3s;
}

/* HEADER */

.site-header {
  
  padding: 0.75rem 0;
  background-color: var(--bg-color);
  
}

.site-logo {
  height: 48px;
  width: auto;
  transition: transform 0.2s ease-in-out;
}

.site-logo:hover {
  transform: scale(1.05);
}

.site-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-color);
}

.theme-icon-btn {
  background: none;
  border: none;
  padding: 0.25rem;
  color: var(--text-color);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.theme-icon-btn:hover {
  transform: rotate(15deg);
}

/* FOOTER */

.site-footer {
  /* position: sticky;*/
  bottom: 0;

  background-color: var(--card-bg);
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-color);
  padding-top: 2rem;
  padding-bottom: 2rem;
  margin-top: auto; /* important pour flex */
}


.site-footer a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

.site-footer a:hover {
  color: #2f855a;
  text-decoration: underline;
}

/* COOKIE BANNER */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}

/* MAP */

#map, .map-container {
  height: 70vh;
  max-height: 700px;
}

/* STATS & CONTROLS */

.stats-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.stats-search {
  display: flex;
  align-items: center;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  padding: 0.25rem 0.75rem;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.stats-search i {
  color: #718096;
  font-size: 1.125rem;
  margin-right: 0.5rem;
}

.stats-search-input {
  border: none;
  outline: none;
  font-size: 1rem;
  width: 200px;
  background: transparent;
  color: var(--text-color);
}

.stats-export-btn,
.stats-show-logs-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #38a169;
  border: none;
  border-radius: 0.375rem;
  color: #fff;
  padding: 0.5rem;
  font-size: 1.125rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.stats-export-btn:not(:disabled):hover {
  background-color: #2f855a;
}

.stats-show-logs-btn:not(:disabled):hover {
  background-color: #2b6cb0;
}

.stats-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stats-filter-select {
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: var(--bg-color);
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-color);
}

/* RESULTS */

.stats-results {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 250px;
  overflow-y: auto;
}

.stats-results li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.stats-results li:last-child {
  border-bottom: none;
}

.stats-results li:hover {
  background: #edf2f7;
}

/* TITRES */

.section-title {
  position: relative;
  font-size: 2.25rem;
  font-weight: 600;
  color: var(--text-color);
  text-align: center;
  margin: 1.5rem 0 1rem;
}

.section-title::after {
  content: "";
  display: block;
  width: 4rem;
  height: 0.25rem;
  background-color: #48bb78;
  border-radius: 0.125rem;
  margin: 0.5rem auto 0;
}

.section-title--secondary::after {
  content: "";
  display: block;
  width: 3rem;
  height: 0.25rem;
  background: #ed8936;
  margin: 0.5rem auto 0;
  border-radius: 0.125rem;
}

.section-title--secondary {
  font-size: 1.75rem;
  color: var(--text-color);
  text-align: center;
  margin-top: 2rem;
  position: relative;
}

/* HEATMAP */

.heatmap-grid {
  display: grid;
  grid-template-columns: 4rem repeat(24, 1fr);
  gap: 1px;
  background: var(--border-color);
  margin: 2rem 0;
}

.heatmap-grid .header {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  height: 1.75rem;
}
.heatmap-grid .date-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem;
  white-space: nowrap;
  color: var(--text-color);
  border-right: 1px solid var(--border-color);
}

.heatmap-grid .map-cell {
  width: 100%;
  height: 1.5rem;
  border: 1px solid var(--border-color);
}

.heatmap-grid .map-cell.empty {
  background: #48bb78;
}
.heatmap-grid .map-cell.full {
  background: #e53e3e;
}
.heatmap-grid .map-cell.future {
  background: #888181;
  cursor: not-allowed;
}

/* POPUP */

.popup-card {
  max-width: 300px;
  max-height: 5000px;
  font-family: sans-serif;
  overflow: scroll;
  background-color: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.pav-block {
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0;
}

.pav-name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.pav-status {
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
}

.pav-status.full {
  color: #fff;
  background-color: #dc3545;
}

.pav-status.empty {
  color: #fff;
  background-color: #198754;
}

.pav-actions {
  display: flex;
  justify-content: flex-start;
}

#theme-icon {
  font-size: 1.1rem;
}

.info-banner {
  background-color: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 0.375rem;
}

#dispoChart {
  max-width: 400px;
  max-height: 400px;
  margin: 0 auto;
}

.accordion-body {
  text-align: justify;
}

.no-print {
  display: block;
}
@media print {
  .no-print {
    display: none !important;
  }
}

/* RESPONSIVE */

@media (max-width: 768px) {
  .site-title {
    font-size: 1.5rem;
  }

  .theme-icon-btn {
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
  }
}

@media (max-width: 600px) {
  .popup-card {
    max-height: 300px;
    font-size: 0.85rem;
  }

  .btn {
    width: 100%;
    font-size: 0.8rem;
  }

  .pav-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  #map {
    height: 400px;
  }
}
