/* ==================================================
   MÉTÉO ALSACE - STYLES
   ================================================== */

:root {
  --meteo-primary: #3b82f6;
  --meteo-secondary: #0ea5e9;
  --meteo-bg: #0b1220;
  --meteo-card: #0f1a2e;
  --meteo-text: #eaf0ff;
  --meteo-muted: rgba(234,240,255,.72);
  --meteo-border: rgba(255,255,255,.10);
  --meteo-shadow: 0 12px 40px rgba(0,0,0,.35);
}

/* =========================
   HERO SECTION
   ========================= */
.meteo-hero {
  background: linear-gradient(135deg, #0f1a2e 0%, #1e293b 100%);
  border-radius: 24px;
  padding: 32px;
  margin-bottom: 24px;
  border: 1px solid var(--meteo-border);
  box-shadow: var(--meteo-shadow);
}

.meteo-hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.meteo-hero-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.meteo-hero-icon {
  font-size: 56px;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(255,255,255,.3));
  animation: pulse-hero 2s ease-in-out infinite;
}

@keyframes pulse-hero {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.meteo-hero-title h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 900;
  color: var(--meteo-text);
}

.meteo-hero-subtitle {
  margin: 4px 0 0;
  color: var(--meteo-muted);
  font-size: 15px;
}

/* =========================
   RECHERCHE
   ========================= */
.meteo-search {
  display: flex;
  gap: 10px;
  min-width: 300px;
}

.meteo-search input {
  flex: 1;
  height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  border: 2px solid var(--meteo-border);
  background: rgba(255,255,255,.08);
  color: var(--meteo-text);
  font-size: 15px;
  outline: none;
  transition: all .2s ease;
}

.meteo-search input:focus {
  border-color: var(--meteo-primary);
  background: rgba(255,255,255,.12);
  box-shadow: 0 0 0 4px rgba(59,130,246,.15);
}

.search-btn {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 0;
  background: var(--meteo-primary);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all .2s ease;
}

.search-btn:hover {
  background: var(--meteo-secondary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59,130,246,.3);
}

/* =========================
   MÉTÉO ACTUELLE
   ========================= */
.meteo-current {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.current-wrapper {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: center;
  width: 100%;
}

.current-main {
  text-align: center;
}

.current-temp,
.current-description,
.current-main h2 {
  color: #0b1220; /* texte sombre lisible sur fond clair */
  font-weight: 600;
}


.current-icon {
  font-size: 96px;
  margin: 16px 0;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,.3));
  animation: float-icon 3s ease-in-out infinite;
}

@keyframes float-icon {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-10px) scale(1.05); }
}

.current-description {
  font-size: 20px;
  color: var(--meteo-text);
  text-transform: capitalize;
  margin: 8px 0 0;
  font-weight: 600;
  opacity: .92;
}

.current-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.info-item {
  background: rgba(15,26,46,.55);          /* + sombre => lisible partout */
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--meteo-border);
}

.info-label {
  font-size: 13px;
  color: rgba(11,18,32,0.65);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
  font-weight: 700;
}

.info-value {
  font-size: 24px;
  color: #0b1220;
  font-weight: 700;
}

/* =========================
   LOADING
   ========================= */
.loading {
  text-align: center;
  padding: 40px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,.1);
  border-top-color: var(--meteo-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

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

/* =========================
   PRÉVISIONS 5 JOURS
   ========================= */
.meteo-forecast {
  background: var(--meteo-bg);
  border-radius: 24px;
  padding: 32px;
  margin-bottom: 24px;
  border: 1px solid var(--meteo-border);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 900;
  color: var(--meteo-text);
  margin: 0 0 24px;
}

.section-icon {
  font-size: 32px;
  filter: drop-shadow(0 2px 6px rgba(255,255,255,.2));
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.forecast-card {
  background: var(--meteo-card);
  border: 1px solid var(--meteo-border);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  transition: transform .2s ease;
}

.forecast-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

.forecast-day {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,.9);
  margin-bottom: 12px;
}

.forecast-icon {
  font-size: 56px;
  margin: 12px 0;
  filter: drop-shadow(0 2px 8px rgba(255,255,255,.3));
  transition: transform .3s ease;
}

.forecast-card:hover .forecast-icon {
  transform: scale(1.1);
}

.forecast-temp {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  margin: 12px 0 8px;
}

.forecast-desc {
  font-size: 13px;
  color: rgba(255,255,255,.85);
  text-transform: capitalize;
  font-weight: 500;
}

/* =========================
   DÉTAILS
   ========================= */
.meteo-details {
  background: var(--meteo-bg);
  border-radius: 24px;
  padding: 32px;
  margin-bottom: 24px;
  border: 1px solid var(--meteo-border);
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.detail-card {
  background: var(--meteo-card);
  border: 1px solid var(--meteo-border);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}

.detail-icon {
  font-size: 48px;
  margin-bottom: 12px;
  filter: drop-shadow(0 2px 8px rgba(255,255,255,.25));
}

.detail-label {
  font-size: 13px;
  color: rgba(234,240,255,0.75);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
  font-weight: 700;
}

.detail-value {
  font-size: 28px;
  color: #ffffff;
  font-weight: 600;
}

/* =========================
   CARTE
   ========================= */
.meteo-map {
  background: var(--meteo-bg);
  border-radius: 24px;
  padding: 32px;
  margin-bottom: 24px;
  border: 1px solid var(--meteo-border);
}

.map-wrapper {
  position: relative;
}

#weatherMap {
  width: 100%;
  height: 500px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--meteo-border);
}

.map-controls {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.map-btn {
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--meteo-border);
  background: var(--meteo-card);
  color: var(--meteo-text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s ease;
}

.map-btn:hover {
  background: rgba(59,130,246,.15);
  border-color: var(--meteo-primary);
}

.map-btn.active {
  background: var(--meteo-primary);
  border-color: var(--meteo-primary);
  color: #fff;
}

/* =========================
   VILLES
   ========================= */
.cities-grid {
  background: var(--meteo-bg);
  border-radius: 24px;
  padding: 32px;
  margin-bottom: 24px;
  border: 1px solid var(--meteo-border);
}

.cities-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.city-card {
  background: var(--meteo-card);
  border: 1px solid var(--meteo-border);
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: all .2s ease;
  text-decoration: none;
  color: inherit;
}

.city-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  border-color: var(--meteo-primary);
}

.city-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--meteo-text);
  margin-bottom: 12px;
}

.city-weather {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.city-temp {
  font-size: 32px;
  font-weight: 900;
  color: var(--meteo-text);
}

.city-icon {
  font-size: 48px;
  filter: drop-shadow(0 2px 8px rgba(255,255,255,.3));
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 1024px) {
  .forecast-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .details-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .cities-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .meteo-hero {
    padding: 24px 20px;
  }
  
  .meteo-hero-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .meteo-search {
    width: 100%;
    min-width: auto;
  }
  
  .meteo-hero-title h1 {
    font-size: 26px;
  }
  
  .meteo-hero-icon {
    font-size: 40px;
  }
  
  .current-wrapper {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }
  
  .current-temp {
    font-size: 56px;
  }
  
  .current-icon {
    font-size: 64px;
  }
  
  .forecast-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .details-grid {
    grid-template-columns: 1fr;
  }
  
  .cities-list {
    grid-template-columns: 1fr;
  }
  
  .section-title {
    font-size: 20px;
  }
  
  #weatherMap {
    height: 400px;
  }
}

@media (max-width: 480px) {
  .meteo-hero {
    padding: 20px 16px;
    border-radius: 20px;
  }
  
  .meteo-hero-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .meteo-hero-title h1 {
    font-size: 22px;
  }
  
  .forecast-grid {
    grid-template-columns: 1fr;
  }
  
  .current-info {
    grid-template-columns: 1fr;
  }
  
  .map-controls {
    flex-direction: column;
  }
  
  .map-btn {
    width: 100%;
  }
  
  #weatherMap {
    height: 300px;
  }
}

/* ===============================
   FIX LISIBILITÉ TEXTE – MÉTÉO
   =============================== */

/* Bloc météo principal (fond clair glass) */
.meteo-card-light,
.meteo-current,
.meteo-overview {
  color: #0f172a; /* texte sombre lisible */
}

/* Ville + température */
.meteo-city,
.meteo-temp,
.meteo-condition {
  color: #0b1220;
  font-weight: 600;
}

/* Labels (Ressenti, Humidité, etc.) */
.meteo-stat-label,
.meteo-label {
  color: rgba(15, 23, 42, 0.7);
  font-weight: 500;
}

/* Valeurs importantes */
.meteo-stat-value,
.meteo-value {
  color: #0b1220;
  font-weight: 700;
}

/* Icônes météo */
.meteo-icon,
.meteo-stat-icon {
  opacity: 0.9;
  filter: none;
}

/* ===============================
   DÉTAILS COMPLETS (cartes)
   =============================== */

.meteo-details-card {
  color: #0f172a;
}

.meteo-details-card h4,
.meteo-details-card .label {
  color: rgba(15, 23, 42, 0.75);
  font-weight: 600;
}

.meteo-details-card .value {
  color: #0b1220;
  font-weight: 700;
}

/* Heures Lever / Coucher */
.meteo-time {
  color: #0b1220;
  font-size: 1.1rem;
  font-weight: 700;
}

/* ===============================
   CONTRASTE GLOBAL (sécurité)
   =============================== */

.meteo-card-light * {
  text-shadow: none;
}
/* ===============================
   FIX LISIBILITÉ (patch ciblé)
   =============================== */

/* 1) Nom de ville (inline style dans meteo.js) */
.current-main h2{
  color: #0b1220 !important;   /* écrase color:var(--meteo-text) inline */
  opacity: 1 !important;
  text-shadow: 0 1px 0 rgba(255,255,255,.25);
}

/* 2) Valeurs des cartes "Détails complets" */
.detail-value{
  color: #ffffff !important;
  opacity: 1 !important;
  text-shadow: 0 2px 12px rgba(0,0,0,.35);
}
/* ===============================
   TEMPÉRATURE PRINCIPALE (GROSSE)
   =============================== */

.current-temp{
  font-size: clamp(56px, 7vw, 96px); /* responsive : mobile → desktop */
  font-weight: 800;
  line-height: 1;
  color: #0b1220; /* cohérent avec Strasbourg */
  letter-spacing: -1px;
}

/* symbole °C légèrement plus petit mais aligné */
.current-temp sup,
.current-temp .unit{
  font-size: 0.45em;
  font-weight: 700;
  vertical-align: super;
}



