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

body {
  font-family: "Barlow", "Segoe UI", system-ui, sans-serif;
}

/* -- Variables -- */
:root {
  --bleu-color: #245aa6;
  --light-blue-color: #ccdcf4;
  --orange-color: #fbb911;
  --dark-gray-color: #4c585e;
  --border-color: #e8e8e8;
  --gray-color: #bbb;
  --gray-text: #aaa;
}

/* -- Widget container -- */
.widget {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* -- Switcher -- */
.switcher {
  display: flex;
  gap: 8px;
  border: 1px solid var(--border-color);
  width: fit-content;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.switcher-btn {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-family: inherit;
  color: black;
  background: transparent;
  border-radius: 20px;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.switcher-btn.active {
  background: var(--orange-color);
  color: white;
  font-weight: 700;
}

/* -- panel de contenu par ville -- */
.view-panels {
  margin-top: 16px;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel-placeholder {
  font-size: 0.85rem;
  color: var(--dark-gray-color);
  padding: 12px 0;
}

/* -- Bloc taxon -- */
.taxon-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* -- Titre (image + nom) -- */
.taxon-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.taxon-img {
  width: 90px;
  height: 90px;
  object-fit: contain;
}

.taxon-name {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: "Poppins", sans-serif;
  color: var(--bleu-color);
}

.taxon-body {
  display: flex;
  align-items: center;
  gap: 32px;
}

/* -- Card graphique -- */
.taxon-card {
  position: relative;
  flex: 1;
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
  overflow: hidden;
  background: #fff;
}

/* -- Info paragraphe -- */
.taxon-info {
  width: 250px;
  flex-shrink: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--dark-gray-color);
}

/* -- Boutons zoom -- */
.zoom-btns {
  display: flex;
  gap: 4px;
}

.zoom-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  font-size: 1.2rem;
  line-height: 26px;
  text-align: center;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  color: var(--orange-color);
  transition: color 0.15s;
}

.zoom-btn:disabled {
  color: var(--gray-color);
  cursor: default;
}

/* -- Graphique -- */
.chart-container {
  position: relative;
  width: 100%;
  height: 300px;
  margin: 16px 0 8px 0;
}

.pollen-widget {
  width: 100%;
  height: 300px;
  display: block;
}

/* -- Surcharge du style Driver.js -- */
.driver-popover-title {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  color: var(--bleu-color);
}

.driver-popover-description {
  font-family: "Barlow", "Segoe UI", system-ui, sans-serif;
  font-size: 0.9rem;
  color: var(--dark-gray-color);
}

.driver-popover-navigation-btns button {
  font-family: "Barlow", sans-serif;
  font-weight: 600;
  border-radius: 20px;
  padding: 6px 16px;
  cursor: pointer;
  text-shadow: none;
}
.driver-popover .driver-popover-next-btn {
  background: var(--light-blue-color);
  color: var(--bleu-color);
  border: none;
}

.driver-popover .driver-popover-next-btn:hover {
  background: var(--light-blue-color);
  opacity: 0.75;
}

.driver-popover .driver-popover-prev-btn {
  color: var(--dark-gray-color);
  border: 1px solid var(--border-color);
}

.driver-popover .driver-popover-prev-btn:hover {
  background: var(--border-color);
}

/* -- Ancres invisibles pour le tutoriel (toolbox et datazoom ECharts sur canvas) -- */
.toolbox-anchor {
  position: absolute;
  top: 0;
  right: 16px;
  width: 72px;
  height: 26px;
  pointer-events: none;
}

.datazoom-anchor {
  position: absolute;
  bottom: 10px;
  left: 38px;
  right: 16px;
  height: 34px;
  pointer-events: none;
}

.legend-anchor {
  position: absolute;
  bottom: 55px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 14px;
  pointer-events: none;
}

/* -- Footer graphique -- */
.chart-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 10px;
  color: var(--dark-gray-color);
  font-size: 0.75rem;
}

.chart-footer-icon {
  width: 14px;
  height: 14px;
}

/* -- CTA calendrier -- */
.chart-cta {
  position: absolute;
  top: 0px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--orange-color);
  font-size: 13px;
  font-weight: 600;
  z-index: 5;
  user-select: none;
  white-space: nowrap;
}

.chart-cta-icon {
  width: 26px;
  height: 26px;
}

.chart-cta:hover {
  opacity: 0.75;
}

/* -- Spinner de chargement -- */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 10;
}

.loading-overlay p {
  font-size: 0.8rem;
  color: var(--gray-text);
  letter-spacing: 0.04em;
}

.loading-overlay.hidden {
  display: none;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-color);
  border-top-color: var(--bleu-color);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 700px) {
  .taxon-body {
    flex-direction: column;
  }

  .taxon-info {
    width: 100%;
  }
}
