/* ============================================================
   MODULE MÉTÉO — LES FOULÉES DES LUMIÈRES 2026
   weather.css

   Préfixe BEM : .wm-* (weather module)
   Dépend des variables CSS définies dans main.css ou index.html
   ============================================================ */


/* ─── CARTE PRINCIPALE ─────────────────────────────────────── */

.wm-card {
  background: rgba(7, 28, 59, 0.75);
  border: 1px solid rgba(58, 155, 216, 0.2);
  border-radius: 20px;
  padding: 2rem;
  backdrop-filter: blur(12px);
  max-width: 900px;
  margin: 0 auto;
}


/* ─── EN-TÊTE ───────────────────────────────────────────────── */

.wm-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(58, 155, 216, 0.12);
}

.wm-header__eyebrow {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.2rem;
}

.wm-header__date {
  font-size: 0.85rem;
  color: var(--txt-muted);
  font-weight: 400;
}

.wm-header__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  padding-left: 1rem;
}

.wm-header__source {
  font-size: 0.68rem;
  color: rgba(34, 197, 94, 0.7);
  letter-spacing: 0.5px;
}

.wm-header__source--offline {
  color: rgba(245, 158, 11, 0.7);
}

.wm-header__update {
  font-size: 0.68rem;
  color: rgba(184, 212, 240, 0.4);
  text-align: right;
  white-space: nowrap;
}


/* ─── TENDANCE ──────────────────────────────────────────────── */

.wm-tendency {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  padding: 0.55rem 0.9rem;
  background: rgba(58, 155, 216, 0.05);
  border: 1px solid rgba(58, 155, 216, 0.12);
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--txt-muted);
}

.wm-tendency__arrow {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  color: var(--primary);
  opacity: 0.8;
}

.wm-tendency__text {
  line-height: 1.4;
}


/* ─── STATUT GLOBAL ─────────────────────────────────────────── */

.wm-status {
  border-radius: 14px;
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.75rem;
  border: 1px solid transparent;
  border-left-width: 4px;
}

.wm-status--green  { background: rgba(34, 197, 94, 0.07);  border-color: rgba(34, 197, 94, 0.35);  border-left-color: #22C55E; }
.wm-status--orange { background: rgba(245, 158, 11, 0.07); border-color: rgba(245, 158, 11, 0.35); border-left-color: #F59E0B; }
.wm-status--red    { background: rgba(239, 68, 68, 0.07);  border-color: rgba(239, 68, 68, 0.35);  border-left-color: #EF4444; }

.wm-status__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.wm-status--green  .wm-status__badge { color: #22C55E; }
.wm-status--orange .wm-status__badge { color: #F59E0B; }
.wm-status--red    .wm-status__badge { color: #EF4444; }

.wm-status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  animation: wm-blink 2.2s ease-in-out infinite;
}

@keyframes wm-blink {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(1.4); }
}

.wm-status__title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--txt);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
  line-height: 1.2;
}

.wm-status__message {
  color: var(--txt-muted);
  font-size: 0.9rem;
  line-height: 1.55;
  max-width: 620px;
}


/* ─── LIBELLÉ DE SECTION ────────────────────────────────────── */

.wm-section {
  margin-bottom: 1.5rem;
}

.wm-section--last {
  margin-bottom: 0;
}

.wm-section__title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.66rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1rem;
  opacity: 0.85;
}

.wm-section__title svg {
  flex-shrink: 0;
  opacity: 0.8;
}


/* ─── TIMELINE ──────────────────────────────────────────────── */

.wm-timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

.wm-slot {
  background: rgba(58, 155, 216, 0.05);
  border: 1px solid rgba(58, 155, 216, 0.13);
  border-radius: 12px;
  padding: 1rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.wm-slot:hover {
  border-color: rgba(58, 155, 216, 0.3);
  background: rgba(58, 155, 216, 0.09);
}

.wm-slot__time {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 0.1rem;
  line-height: 1;
}

.wm-slot__label {
  font-size: 0.67rem;
  color: var(--txt-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 0.65rem;
  line-height: 1.35;
  opacity: 0.8;
}

.wm-slot__temp {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--txt);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.wm-slot__feels {
  display: block;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--txt-muted);
  font-family: 'Inter', sans-serif;
  margin-top: 0.2rem;
  opacity: 0.8;
}

.wm-slot__meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.65rem;
}

.wm-slot__wind,
.wm-slot__rain {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.73rem;
  color: var(--txt-muted);
  opacity: 0.85;
}

.wm-slot__rain--wet {
  color: #60A5FA;
  opacity: 1;
}

.wm-slot__comment {
  font-size: 0.73rem;
  color: var(--txt-muted);
  font-style: italic;
  line-height: 1.45;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(58, 155, 216, 0.1);
  opacity: 0.9;
}


/* ─── RANGÉE INDICE + DOTATION ──────────────────────────────── */

.wm-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.wm-panel {
  background: rgba(58, 155, 216, 0.05);
  border: 1px solid rgba(58, 155, 216, 0.13);
  border-radius: 12px;
  padding: 1.2rem;
}


/* ─── INDICE COUREUR ────────────────────────────────────────── */

.wm-score {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
  margin: 0.35rem 0 0.5rem;
  line-height: 1;
}

.wm-score__number {
  font-family: 'Poppins', sans-serif;
  font-weight: 900;
  font-size: 3rem;
  color: var(--txt);
  line-height: 1;
}

.wm-score__max {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--txt-muted);
}

.wm-score__label {
  font-size: 0.8rem;
  color: var(--txt-muted);
  line-height: 1.45;
  opacity: 0.9;
}

.wm-score__impact {
  font-size: 0.78rem;
  color: var(--primary);
  line-height: 1.45;
  margin-top: 0.45rem;
  opacity: 0.85;
}


/* ─── DOTATION ──────────────────────────────────────────────── */

.wm-gear {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

.wm-gear__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--txt-muted);
}

.wm-gear__emoji {
  font-size: 1.05rem;
  line-height: 1;
  flex-shrink: 0;
}

.wm-gear__label {
  line-height: 1.35;
}


/* ─── CONSEILS TERRAIN ──────────────────────────────────────── */

.wm-tips {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.wm-tips__item {
  display: flex;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: var(--txt-muted);
  line-height: 1.5;
}

.wm-tips__bullet {
  color: var(--primary);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.05rem;
  opacity: 0.8;
}


/* ─── ÉTAT DE CHARGEMENT ────────────────────────────────────── */

.wm-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem 2rem;
  color: var(--txt-muted);
  font-size: 0.9rem;
}

.wm-loading__spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(58, 155, 216, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: wm-spin 0.8s linear infinite;
}

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

.wm-loading__text {
  opacity: 0.7;
}


/* ─── RESPONSIVE ────────────────────────────────────────────── */

/* Tablette et grand téléphone */
@media (max-width: 768px) {

  .wm-card {
    padding: 1.25rem;
    border-radius: 16px;
  }

  .wm-header {
    flex-direction: column;
    gap: 0.35rem;
  }

  .wm-header__right {
    align-items: flex-start;
  }

  .wm-header__update {
    text-align: left;
    padding-left: 0;
  }

  .wm-status__title {
    font-size: 1.1rem;
  }

  .wm-status__message {
    font-size: 0.85rem;
  }
}

/* Téléphone : timeline 2×2, pas de scroll horizontal */
@media (max-width: 620px) {

  /* 4 créneaux → grille 2 colonnes */
  .wm-timeline {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    overflow-x: unset; /* annule tout scroll résiduel */
  }

  /* Vent + pluie sur une seule ligne pour gagner de la hauteur */
  .wm-slot__meta {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.2rem 0.7rem;
    margin-bottom: 0.5rem;
  }

  /* Température légèrement réduite */
  .wm-slot__temp {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
  }

  /* Commentaire plus compact */
  .wm-slot__comment {
    font-size: 0.7rem;
    line-height: 1.4;
  }

  /* Indice : chiffre légèrement réduit */
  .wm-score__number {
    font-size: 2.5rem;
  }
}

/* Petit téléphone */
@media (max-width: 480px) {

  .wm-card {
    padding: 1rem;
    border-radius: 14px;
  }

  /* Indice + Tenue : 1 colonne */
  .wm-row {
    grid-template-columns: 1fr;
  }

  .wm-slot {
    padding: 0.85rem;
  }

  .wm-slot__label {
    font-size: 0.64rem;
  }
}
