
/* ################ GLOBALS ################ */

/* ## ► LOADING ◄ ## */

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

#loading {
  background-color: #FFF;
  position: absolute;
  font-family: 'Segoe UI', sans-serif;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 100000;
  transition: opacity 1s ease;
  opacity: 1;
}
.loader {
  width: 54px;
  height: 54px;
  border: 3px solid #EEE;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
}
.loader::after {
  content: '';
  box-sizing: border-box;
  position: absolute;
  left: 0;
  top: 0;
  background: #FF3D00;
  width: 20px;
  height: 20px;
  transform: translate(-50%, 50%);
  border-radius: 50%;
}

/* ## ► INFOS ◄ ## */

.header-title {
  position: absolute;
  top: 35px;
  right: 3vw;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #004d40;
  max-width: 750px;
  padding: 1.5rem 2rem;
  z-index: 999;
  background: transparent;
  pointer-events: none;
  transition: opacity 1s;
}

.header-title h1 {
  font-weight: 700;
  font-size: 2.5rem;
  margin: 0 0 0.25rem 0;
  line-height: 1.1;
  letter-spacing: 0.05em;
}

.header-title .subtitle {
  font-size: 1.15rem;
  margin: 0 0 0.8rem 0;
  color: #00695c;
  font-weight: 500;
}

.header-title .others {
  align-items: center;
  text-align: center;
}

.header-title .credits {
  font-size: 0.8rem;
  color: #357a38;
  opacity: 0.8;
}

.header-title .description {
  pointer-events: auto;
}

.header-title strong {
  font-weight: 600;
}

.header-title a {
  font-weight: 800;
  color: #004d40;
}

/* ## ► MAP ◄ ## */

#map {
  height: 96vh;
  top: -2vh;
  position: relative;
  z-index: 1;
}

.leaflet-magnifying-glass {
  z-index: 1000 !important;
  pointer-events: none !important;
  border-radius: 50%;
  border: 1px solid gray;
  box-shadow: 0 0 5px gray;
  position: absolute;
  overflow: hidden;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
.leaflet-magnifying-glass * {
  pointer-events: none !important;
}

.leaflet-magnifying-glass > .leaflet-container {
  height: 	100%;
  width: 	100%;
  z-index: 1000 !important;
}

.leaflet-magnifying-glass-webkit {
  border-radius: 50%;
  z-index: 1000 !important;
  -webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);
}
.leaflet-magnifying-glass.fade-out {
  transition: all 0.8s ease;
  opacity: 0;
  transform: scale(0.5) rotate(15deg) blur(3px);
}

path.island-feature {
  fill: url(#island-texture);
  stroke: #333;
  stroke-width: 1;
}

.curved-label {
  pointer-events: none;
  position: absolute;
  transform: translate(-50%, -50%);
}
.curved-label svg {
  overflow: visible;
}
.curved-label text {
  font-size: 14px;
  fill : #000;
  text-shadow: 2px 2px 2px #EEE;
}

textPath {
  transition: opacity 1s;
}

/* ## ► GRAPHs SCREEN ◄ ## */

#graphs {
  position: absolute;
  font-family: 'Segoe UI', sans-serif;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  flex: 1;
  padding-left: 300px;
  justify-content: center;
  align-content: space-between;
  padding-top: 2vh;
  z-index: 1000;
  display: none;
  overflow: hidden;
}

.info-island-wrapper {
  position: fixed;
  top: 8px;
  left: 8px;
}

.info-island {
  position: fixed;
  top: 10px;
  left: 10px;
  background: transparent;
  border: 2px solid #1f77b4;
  border-bottom-right-radius: 8px;
  padding: 15px;
  width: 250px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.info-island img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 10px;
}
.info-island h2 {
  margin: 0 0 8px 0;
  font-size: 1.3em;
  color: #004080;
}
.info-island p {
  margin: 4px 0;
  font-size: 0.95em;
  color: #333;
}

.back-button {
  position: absolute;
  bottom: -18px;
  left: 85%;
  transform: translateX(-50%);
  background-color: #1f77b4;
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  z-index: 2000;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s;
}

.back-button:hover {
  background-color: #005b94;
}

.back-button::after {
  content: "Retour sur la carte (ou clic gauche)";
  position: absolute;
  left: 50%;
  top: 120%;
  transform: translateX(-50%);
  background-color: #444;
  color: #fff;
  padding: 6px 8px;
  border-radius: 4px;
  white-space: nowrap;
  font-size: 0.65em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.back-button:hover::after{
  opacity: 1;
}

.popup {
  position: fixed;
  z-index: 6000;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 90%;
  max-width: 1000px;
  background: white;
  box-shadow: 0 0 20px rgba(0,0,0,0.2);
  border-radius: 12px 12px 0 0;
  transition: transform 0.4s ease-in-out;
  display: block;
}

.popup.show {
  transform: translateX(-50%) translateY(0);
}

.popup-content {
  padding: 1.5rem;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  font-weight: bold;
  color: #888;
  cursor: pointer;
}

.close-btn:hover {
  color: #333;
}

.popup-body {
  margin-top: 1rem;
  max-height: 60vh;
  overflow-y: auto;
}

/* ################ SCRIPT ################ */

#info-overlay {
  position: fixed;
  top: -2vh; left: 0; right: 0; bottom: 0;
  z-index: 999;
  pointer-events: none;
  display: none;
  overflow: hidden;
}

#info-overlay .circle {
  position: absolute;
  background: white;
  opacity: 0.4;
  border-radius: 50%;
  width: 0px;
  height: 0px;
  mix-blend-mode: normal;
  pointer-events: none;
  mask-image: radial-gradient(circle 110px at center, transparent 110px, black 110px);
  -webkit-mask-image: radial-gradient(circle 110px at center, transparent 110px, black 110px);
}

#full-white-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: white;
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease-in;
}


/* ################ RADAR CHART ################ */

#radarChart {
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  background-color: rgba(255,255,255,0.2);
  border-radius: 50px;
  margin-right: 50px;
  margin-top: 50px;
}
.axisLabel {
  font-size: 12px;
  fill: #333;
}
.radarStroke {
  stroke-width: 2px;
  fill: none;
}
.radarCircle {
  fill-opacity: 0.9;
  cursor: pointer;
}
.radar-tooltip {
  position: absolute;
  background: white;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}


/* ################ LINE CHART ################ */

select {
  padding: 6px 10px;
  margin-right: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

select:disabled {
  background-color: rgba(255,255,255,0.2);
  border: 0px;
  appearance: none;
  color: #222222;
  opacity: 1;
}

#lineChart {
  z-index: 3000;
  overflow: visible;
  background-color: rgba(255,255,255,0.2);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  border-radius: 50px;
  padding: 40px 5px;
}

#controls {
  position: absolute;
  display: flex;
  bottom: 570px;
  left: 65%;
  z-index: 4000;
  justify-content: center;
  align-items: center;
  gap: 10%;
  flex-wrap: nowrap;
}

.ind1-infos, .ind2-infos {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  gap: 5px;
}

.ind1-info-title {
  font-size: 15px;
  margin: 0;
  white-space: nowrap;
  overflow: visible;
  text-overflow: unset;
  flex: 1 1 auto;
}

.line1 {
  stroke: #1f77b4;
  stroke-width: 2.5px;
  fill: none;
}

.line2 {
  stroke: orange;
  stroke-width: 2.5px;
  fill: none;
  stroke-dasharray: 5 4;
}

.axis path,
.axis line {
  stroke: #ccc;
  shape-rendering: crispEdges;
}

.btn-inline {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.3rem 0.8rem;
  font-size: 14px;
  font-weight: 500;
  color: #1f77b4;
  background-color: #f0f4f8;
  border: 1px solid #cbd6e2;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}

.btn-inline:hover {
  background-color: #e0ebf5;
  color: #003f7d;
  border-color: #1f77b4;
}
