/* Carte météo : fond, halo et layout */

.card--weather {
  position: relative;
  overflow: hidden;
}

/* halo animé par-dessus le gradient de .card::before */
.card--weather::after {
  content: "";
  position: absolute;
  top: -20%;
  left: -10%;
  width: 140%;
  height: 140%;
  background: radial-gradient(circle at 30% 0%, rgba(255,255,255,0.10), transparent 60%);
  filter: blur(10px);
  opacity: 0.8;
  animation: weatherGlow 14s ease-in-out infinite;
  pointer-events: none;
}

@keyframes weatherGlow {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.7;
  }
  50% {
    transform: translate3d(8px, 4px, 0) scale(1.04);
    opacity: 1;
  }
}

/* Teinte de fond selon météo (optionnel) */
.card--weather.sunny::before {
  background: radial-gradient(circle at top left, rgba(255,200,0,0.16), transparent 60%);
}

.card--weather.rain::before {
  background: radial-gradient(circle at top left, rgba(90,140,255,0.18), transparent 60%);
}

.card--weather.clouds::before {
  background: radial-gradient(circle at top left, rgba(200,210,230,0.12), transparent 55%);
}

/* Température principale + infos */

.main-temp {
  font-size: 46px;
  font-weight: 600;
  line-height: 1;
}

.main-temp span {
  font-size: 26px;
  opacity: 0.7;
}

.weather-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  gap: 8px;
}

.weather-meta {
  font-size: 14px;
  color: var(--muted);
}

.weather-meta strong {
  font-size: 14px;
  color: var(--text);
}

/* --------- SUNNY --------- */

#mood-message {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  opacity: 0.95;
}

/* Couleur du message selon l'humeur météo */
body.mood-rainy #mood-message,
body.mood-stormy #mood-message {
  color: #a9c4ff; /* bleu gris frais */
}

body.mood-snowy #mood-message {
  color: #cfe5ff; /* bleu très pâle froid */
}

body.mood-clear #mood-message {
  color: #ffe08a; /* jaune chaud doux */
}

body.mood-cloudy #mood-message {
  color: #c2c8dc; /* gris clair neutre */
}

/* Icône météo : conteneur */

.weather-icon {
  width: 70px;
  height: 70px;
  position: relative;
  z-index: 1;
  margin-left: auto;
  margin-right: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 16px;
}

/* --------- SUNNY --------- */

/* Soleil */
.weather-icon.weather-icon--clear::before {
  content: "";
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffee88, #ffcc33);
  box-shadow: 0 0 14px rgba(255, 220, 120, 0.7);
}

/* --------- CLOUDS / MIST --------- */

/* Nuages */
.weather-icon.weather-icon--clouds::before,
.weather-icon.weather-icon--mist::before {
  content: "";
  position: absolute;
  bottom: 16px;
  left: 8px;
  width: 54px;
  height: 26px;
  border-radius: 26px;
  background: linear-gradient(145deg, #f4f7ff, #d6dbea);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  opacity: 0.9;
}

.weather-icon.weather-icon--clouds::after,
.weather-icon.weather-icon--mist::after {
  content: "";
  position: absolute;
  bottom: 24px;
  left: 20px;
  width: 34px;
  height: 20px;
  border-radius: 20px;
  background: linear-gradient(145deg, #e5e9f5, #c8cee0);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  opacity: 0.9;
}



/* --------- RAIN --------- */

/* Pluie */
.weather-icon.weather-icon--rain::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 8px;
  width: 54px;
  height: 26px;
  border-radius: 26px;
  background: linear-gradient(145deg, #f4f7ff, #d6dbea);
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.weather-icon.weather-icon--rain::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 40px;                         /* légèrement plus bas */
  width: 40px;
  height: 26px;                      /* un peu plus haut */
  background-image:
    radial-gradient(circle, rgba(185,215,255,0.95) 0, rgba(185,215,255,0.95) 18%, transparent 19%),
    radial-gradient(circle, rgba(185,215,255,0.95) 0, rgba(185,215,255,0.95) 18%, transparent 19%),
    radial-gradient(circle, rgba(185,215,255,0.95) 0, rgba(185,215,255,0.95) 18%, transparent 19%);
  background-size: 6px 10px;         /* gouttes un peu plus grandes */
  background-position:
    0 0,
    16px -2px,
    32px 2px;
  background-repeat: no-repeat;
}

@keyframes rainShake {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(1px); }
}

.weather-icon.weather-icon--rain {
  animation: rainShake 2.4s ease-in-out infinite;
}

/* --------- STORM --------- */

/* Orage */
.weather-icon.weather-icon--thunderstorm::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 6px;
  width: 56px;
  height: 28px;
  border-radius: 28px;
  background: linear-gradient(145deg, #5a5b66, #2f3038);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.weather-icon.weather-icon--thunderstorm::after {
  content: "";
  position: absolute;
  left: 28px;
  top: 36px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 14px solid #ffd93b;             /* un peu plus grand */
  filter: drop-shadow(0 0 4px rgba(255,217,59,0.7));
}

/* --------- SNOW --------- */

/* Neige */
.weather-icon.weather-icon--snow::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 8px;
  width: 54px;
  height: 26px;
  border-radius: 26px;
  background: linear-gradient(145deg, #ffffff, #e4e7f0);
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.weather-icon.weather-icon--snow::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 38px;
  width: 40px;
  height: 24px;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.95) 0, rgba(255,255,255,0.95) 12%, transparent 13%),
    radial-gradient(circle, rgba(255,255,255,0.85) 0, rgba(255,255,255,0.85) 12%, transparent 13%),
    radial-gradient(circle, rgba(255,255,255,0.9) 0, rgba(255,255,255,0.9) 12%, transparent 13%);
  background-size: 7px 7px;
  background-position:
    0 0,
    14px -2px,
    30px 2px;
  opacity: 0.95;
}

@keyframes snowDrift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1px); }
}

.weather-icon.weather-icon--snow {
  animation: snowDrift 3s ease-in-out infinite;
}

/* --------- NUIT --------- */
/* Icône lune en arrière-plan (nuit) */
.weather-icon--moon {
  position: absolute;
  top: -30%;
  left: -20%;
  transform: translate(50%, 50%);
  width: 80px;
  height: 80px;
  font-size: 80px;
  line-height: 80px;
  text-align: center;
  color: rgba(255, 255, 255, 0.2);
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

/* Animation de flottement léger (pas de rotation) */
@keyframes moonFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-3px); }
}

.weather-icon--moon.animated {
  animation: moonFloat 4s ease-in-out infinite;
}

/* --------- JOUR --------- */
.weather-icon--sun {
  position: absolute;
  top: -30%;
  left: -20%;
  transform: translate(50%, 50%);
  width: 80px;
  height: 80px;
  font-size: 80px;
  line-height: 80px;
  text-align: center;
  color: rgba(255, 255, 255, 0.2);
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

/* Animation de flottement léger (pas de rotation) */
@keyframes sunFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-3px); }
}

.weather-icon--sun.animated {
  animation: moonFloat 4s ease-in-out infinite;
}

/* Conteneur icône météo */


/* Icône météo avec fond blanc (nuit) */
.weather-icon--clear,
.weather-icon--clouds,
.weather-icon--rain,
.weather-icon--thunderstorm,
.weather-icon--snow {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* Icônes météo définies par pseudo-éléments CSS ci-dessus */

/* Fond sombre la nuit */
.card--weather.clouds {
  background: linear-gradient(135deg, #1a1f29 0%, #050816 100%);
}

/* --------- TIMELIME --------- */
/* Timeline météo */

.weather-timeline {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  overflow-x: auto;
}

.weather-timeline-item {
  min-width: 60px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.weather-timeline-item strong {
  color: var(--accent);
  font-size: 12px;
}

.weather-timeline-time {
  opacity: 0.8;
}

.weather-timeline-desc {
  font-size: 10px;
  opacity: 0.9;
}

.weather-timeline-item--rain {
  background: rgba(90,140,255,0.25);
}

.weather-timeline-item--snow {
  background: rgba(180,210,255,0.25);
}
