/* ============================================================
   STYLE GLOBAL
============================================================ */

body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  background: #001f3f;
  color: white;

  display: flex;
  align-items: stretch;
  flex-direction: column;
  min-height: 100vh;

}

html, body {
  width: 100%;
  margin: 0;
  padding: 0;
}
:root {
  --neon-green: #00ff66;
  --weather-cycle: 18s;

  /* ⭐ SCROLLBAR — SOURCE UNIQUE */
  --scrollbar-thumb: rgba(255,255,255,0.55);
  --scrollbar-thumb-hover: rgba(255,255,255,0.80);
  --scrollbar-track: transparent;
}

/* ============================================================
   SCROLLBAR GLOBALE — SOURCE UNIQUE
============================================================ */

/* Chrome / Edge / Safari */
::-webkit-scrollbar {
  width: 10px; /* scrollbar principale */
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover);
}

::-webkit-scrollbar-thumb:active {
  background-color: var(--scrollbar-thumb-hover);
}

/* Firefox */
html {
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
/* ===============================
   LOGIN ADMIN — MESSAGE ERREUR
================================ */

#loginError {
  color: #ff0033;
  font-size: 11px;
  margin-top: 6px;
  margin-left: 10px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#loginError.show {
  opacity: 1;
}

/* ============================================================
   DASHBOARD — LAYOUT
============================================================ */
.dashboard {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 10px;

  /* ⭐ padding harmonisé */
  padding: 6px 15px;
  flex: 1;
  align-items: stretch;
}

.column {
  background: #001f3f;

  /* ⭐ padding SYMÉTRIQUE */
  padding: 5px 0 5px 0;

  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
/* ⭐ respiration bas modules critiques */
#wind-module,
#central-module,
.module-x {
  padding-bottom: 10px;
}

#col-gauche > .module:last-child {
  flex-grow: 1;
  min-height: 0;
}
#col-droite > .module:last-child {
  flex-grow: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.module {
  background: #001f3f;
  border: 1px solid white;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.module h3 {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px 0;
  font-size: clamp(1em, 2vw, 1.2em);
  font-weight: 400;
  border-bottom: 1px solid white;
  width: 100%;
  margin-inline: auto;
  padding-bottom: 10px;
  padding-left: 1%;
  padding-right: 1%;
  box-sizing: border-box;
}
.module-icon {
  width: clamp(15px, 3vw, 30px);
  height: auto;
  max-height: 30px;
}

/* ===== SOCIAL TITLE (X) ===== */
.module h3.social-title {
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding-left: 0;
  padding-right: 0;
}

/* ============================================================
   MODULE CENTRAL (iframe / vues)
============================================================ */

.home-content {
  display: flex;
  align-items: flex-start;
  gap: 30px;
  margin-top: 10px;
  width: 100%;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* image */
.home-image img {
  display: block; /* ⭐ clé */
  width: clamp(180px, 25vw, 320px);
  height: auto;
  border-radius: 6px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
  transition: transform 0.25s ease;
}

.home-image {
  display: inline-block;
  line-height: 0;
}
/* ============================================================
   TEXTE QUI COULE AUTOUR DE L’IMAGE (bloc supercellule)
============================================================ */

.home-flow {
  display: block; /* on casse le flex uniquement ici */
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* image flottante à gauche */
.home-flow .home-image {
  float: left;
  display: block;
  width: fit-content; /* adapte à l'image */
  margin: 0 25px 10px 0;
  position: relative; /* pour l'overlay */
  z-index: 2; /* au-dessus du texte */
}
.home-flow .home-image:hover img {
  transform: scale(1.03);
}
.home-flow .home-subtitle {
  position: relative;
  z-index: 1;
}
/* ============================================================
   OVERLAY TITRE SUR IMAGE (supercellule)
============================================================ */

.home-image-overlay {
  position: relative;
  overflow: hidden;
  border-radius: 6px; /* IMPORTANT */
}

.home-image-overlay .image-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  padding: 8px 10px;
  font-size: 0.8rem;
  font-weight: 400;
  text-align: center;

  background: linear-gradient(to top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0));

  color: white;
  opacity: 0;
  transform: translateY(100%);
  transition: all 0.35s ease;
  pointer-events: none;
}

/* apparition au survol */
.home-image-overlay:hover .image-caption {
  opacity: 1;
  transform: translateY(0);
}

/* nettoie le float */
.home-flow::after {
  content: "";
  display: block;
  clear: both;
}

.home-image-big img {
  width: clamp(260px, 38vw, 520px);
}
.home-image:hover img {
  transform: scale(1.03);
}

/* liens vue HOME */
.home-link,
.home-link:visited {
  color: var(--neon-green);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.25s ease;
}

.home-link:hover,
.home-link:active {
  color: var(--neon-green);
  text-decoration: none;
  opacity: 0.8;
}

.home-title {
  margin: 5px 0 10px 0;
  font-weight: 500;
  text-align: center;
  line-height: 1.5;

  font-size: clamp(1.2rem, 2vw, 2rem);
}

.home-subtitle {
  flex: 1;
  margin: 0 5px;
  font-weight: 300;
  text-align: justify;
  text-justify: inter-word;
  max-width: 700px;
  opacity: 0.86;
  line-height: 1.2;

  font-size: clamp(0.9rem, 1vw, 0.95rem);
  margin-bottom: 10px;
}
.home-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;
}
#central-module {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0; /* ⭐ CRITIQUE */
}
/* ===== Ajustement hauteur colonne centrale ===== */

#col-centre {
  min-height: 0;
  display: flex;
  flex-direction: column;
}


.central-view {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden; /* ⭐ empêche double scroll */
}

.central-view.active {
  display: flex;
}

.central-view iframe {
  flex: 1 1 auto;
  width: 100%;
  border: none;

  overflow: auto;   /* ⭐ scroll seulement si besoin */
  min-height: 0;
}

/* ============================================================
   GALERIE PHOTOS
============================================================ */

.gallery-grid {

  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 images par ligne */

  gap: 15px;
  margin-top: 5px;
  width: 100%;
  max-width: 900px;

}

.gallery-item img {

  width: 100%;
  height: 140px;
  object-fit: cover;

  border-radius: 5px;
  cursor: pointer;

  transition: transform 0.3s ease;

}

.gallery-item img:hover {

  transform: scale(1.05);

}
/* ============================================================
   PHOTO VIEWER (mode plein écran)
============================================================ */

.photo-page {

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  min-height: 100vh;
  padding: 20px;
  box-sizing: border-box;

}

.back-gallery {

  display: inline-block;
  padding: 8px 14px;

  border: 1px solid #00ff66;
  border-radius: 6px;

  color: #00ff66;
  text-decoration: none;

  background: transparent;

  transition: all 0.2s ease;

  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;

}

.back-gallery:hover {

  background: rgba(0, 255, 102, 0.1);
  box-shadow: 0 0 8px rgba(0, 255, 102, 0.4);
  color: #00ff66;
  text-decoration: none;

}



.photo-wrapper {

  text-align: center;

}

.photo-wrapper img {

  max-width: 100vw;
  max-height: 88vh;

  width: auto;
  height: auto;

  display: block;
  margin: 0 auto;

  border-radius: 6px;
  box-shadow: 0 0 30px rgba(0,0,0,0.5);

}

.photo-hint {

  margin-top: 12px;
  font-size: 12px;
  color: rgba(255,255,255,0.75);

}
/* ============================================================
   TYPOGRAPHIE & DONNÉES
============================================================ */

.data-row {
  display: flex;
  justify-content: space-between;
  font-size: clamp(0.7em, 1.2vw, 0.8em);
}

.data-title,
.data-value {
  font-weight: 300;
  display: flex;
  align-items: center;
}

.nowrap {
  white-space: nowrap;
}

/* ============================================================
   WIDGET MÉTÉO (forecast)
============================================================ */

#weather-widget {
  display: flex;
  flex-direction: row;
  gap: 10px;
  max-width: 100%;
}

#weather-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 70%;
}

.current-weather {
  display: flex;
  align-items: center;
  gap: 20px;
}

#forecast {
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.forecast-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.8em;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 5px;
  flex: 1;
}

#chart-module {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  overflow-x: hidden;
  overflow-y: visible;
  padding-bottom: 10px;
}

.chart-block {
  width: 100%;
  height: 240px !important;
  min-height: 240px !important;
  max-height: 240px !important;
  position: relative;

  overflow-x: hidden;   /* garde propre horizontal */
  overflow-y: visible;  /* ⭐ laisse vivre le logo */
}

.chart-block > * {
  width: 100% !important;
  height: 100% !important;
}




/* ===========================================
   CONTAINERS PLUIE - CACHÉS PAR DÉFAUT
   =========================================== */
#chartRainMonth,
#chartRainYear {
  display: none;
}


/* ============================================================
   TYPO
============================================================ */

.text {
  font-size: clamp(0.7em, 1.2vw, 0.8em) !important;
  font-weight: 300 !important;
  line-height: 1.25em !important;
}


.module h3.social-title .x-icon {
  filter: brightness(0) invert(1);
}

.module.module-x {
  border: none;          /* ⭐ supprime la double bordure */
  box-sizing: border-box; /* ⭐ sécurise le calcul de hauteur */
  padding-left: 0;
  padding-right: 0;
}

.module-x {
  height: auto;
  min-height: 0;
  overflow: hidden;
  flex: 1 1 auto !important;
}

.custom-x {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  overflow-y: auto;
  padding-right: 4px;
  min-height: 0;
}

.tweet-card {
  display: block;
  text-decoration: none;
  color: white;
  background: transparent;
  border-radius: 5px;
  transition: all 0.25s ease;
}

.tweet-text {
 word-break: break-word;
  font-size: 0.82em;
  line-height: 1.3;
  opacity: 0.95;
}

.tweet-date {
  font-size: 0.7em;
  opacity: 0.6;
  margin-top: 6px;
}

.tweet-empty {
  font-size: 0.8em;
  opacity: 0.7;
  text-align: center;
  padding: 10px 0;
}

.tweet-media {
  margin-bottom: 6px;
  border-radius: 6px;
  overflow: hidden;
}

.tweet-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: cover;
}

/* 3️⃣ scrollbar fine style Sucs */
.custom-x::-webkit-scrollbar {
  width: 6px;
}

/* module social plus fin — Firefox */
.module-x .custom-x {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}


/* ============================================================
   RESPONSIVE
============================================================ */

@media (max-width: 1000px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
  #controls {
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  #chart-module {
    height: 250px;
  }
  #dateSelector {
    min-width: 130px;
  }
  .time-step {
    padding: 4px 10px;
  }
}

#chart-module #controls {
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: center;
  align-items: center;
  gap: 10px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

/* Resserre l’espace entre la date et JOUR */
#chart-module #timeSteps {
  margin-left: 6px;
}
#chart-module {
  border: none !important;
}
