/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:     #0f172a;
  --card:   rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.15);
  --accent: #7c3aed;
  --accent2:#a78bfa;
  --text:   #f1f5f9;
  --muted:  #94a3b8;
  --red:    #f87171;
  --r:      14px;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: url('https://images.unsplash.com/photo-1462331940025-496dfbfc7564?w=1600');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--text);
  padding-bottom: 3rem;
}

/* ── Nav ────────────────────────────────────────────────── */
.topnav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .8rem 1.5rem;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-back {
  color: var(--accent2);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 700;
  transition: color .2s;
}
.nav-back:hover { color: #fff; }

.nav-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

/* ── Container ──────────────────────────────────────────── */
.container {
  max-width: 600px;
  margin: 2rem auto;
  padding: 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── Info key ───────────────────────────────────────────── */
.info-cle {
  background: rgba(255,255,255,0.1);
  border-left: 4px solid var(--accent2);
  border-radius: var(--r);
  padding: .9rem 1.1rem;
  font-size: .88rem;
  color: var(--text);
  backdrop-filter: blur(4px);
  line-height: 1.6;
}
.info-cle strong { color: #ddd6fe; }

/* ── Bloc card ──────────────────────────────────────────── */
.bloc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.5rem 1.75rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

h2 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--text);
}

label {
  display: block;
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: .35rem;
}

select, input[type="number"] {
  width: 100%;
  padding: .6rem .8rem;
  margin-bottom: 1rem;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 7px;
  font-size: .95rem;
  color: #1e1b4b;
}

button[type="submit"] {
  width: 100%;
  padding: .75rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .1s;
}
button[type="submit"]:hover  { background: #6d28d9; }
button[type="submit"]:active { transform: scale(.98); }

.resultat {
  margin-top: 1rem;
  padding: .9rem 1rem;
  background: rgba(124,58,237,0.25);
  border-left: 4px solid var(--accent2);
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  color: var(--text);
}

.erreur {
  margin-top: 1rem;
  padding: .9rem 1rem;
  background: rgba(220,38,38,0.2);
  border-left: 4px solid var(--red);
  border-radius: 8px;
  font-size: .9rem;
  color: #fecaca;
}

/* Ligne monnaies */
.monnaie-ligne { display: flex; gap: .75rem; flex-wrap: wrap; }
.monnaie-champ { flex: 1; min-width: 120px; }
.monnaie-champ select, .monnaie-champ input { width: 100%; }

/* Graphique */
.graphique-wrapper { position: relative; }
.graphique-loading {
  text-align: center; color: var(--accent2);
  font-size: .85rem; padding: .75rem 0; letter-spacing: 1px;
}

.live-badge {
  font-size: .7rem;
  background: rgba(52,211,153,0.2);
  color: #6ee7b7;
  border: 1px solid #6ee7b750;
  border-radius: 2rem;
  padding: .15rem .55rem;
  font-weight: 600;
}


/* ═══════════════════════════════════════════════════════ */
/* MENU HAMBURGER                                            */
/* ═══════════════════════════════════════════════════════ */
.hamburger-btn {
  margin-left: auto;              /* pousse le bouton à droite de la topnav */
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 120;
}
.hamburger-btn span {
  display: block;
  height: 3px;
  width: 100%;
  background: var(--accent2);
  border-radius: 3px;
  transition: transform .25s, opacity .25s;
}
.hamburger-btn.actif span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.hamburger-btn.actif span:nth-child(2) { opacity: 0; }
.hamburger-btn.actif span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.hamburger-menu {
  position: absolute;
  top: 100%;
  right: .75rem;
  min-width: 220px;
  background: rgba(15,23,42,0.97);
  border: 1px solid var(--border);
  border-radius: var(--r);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.hamburger-menu.ouvert {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.hamburger-menu a {
  display: block;
  padding: .8rem 1.2rem;
  color: var(--text);
  text-decoration: none;
  font-size: .95rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background .15s;
}
.hamburger-menu a:last-child { border-bottom: none; }
.hamburger-menu a:hover { background: rgba(124,58,237,0.3); }
.hamburger-menu a.menu-accueil {
  color: var(--accent2);
  background: rgba(255,255,255,0.03);
}

/* ═══════════════════════════════════════════════════════ */
/* HISTORIQUE DE SESSION                                     */
/* ═══════════════════════════════════════════════════════ */
.historique-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.btn-vider {
  width: auto;
  padding: .35rem .9rem;
  background: rgba(220,38,38,0.2);
  color: #fecaca;
  border: 1px solid rgba(248,113,113,0.4);
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-vider:hover { background: rgba(220,38,38,0.35); }

.historique-liste {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.historique-liste li {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem .75rem;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  font-size: .9rem;
}
.historique-heure {
  color: var(--muted);
  font-family: monospace;
  font-size: .8rem;
}
.historique-resultat { color: var(--text); font-weight: 600; }

/* ═══════════════════════════════════════════════════════ */
/* MÉTÉO                                                     */
/* ═══════════════════════════════════════════════════════ */
.recherche-ligne {
  display: flex;
  gap: .6rem;
}
.recherche-ligne input {
  flex: 1;
  margin-bottom: 0;
}
.recherche-ligne button {
  width: auto;
  padding: .6rem 1.4rem;
}

.meteo-resultat { text-align: center; }

.meteo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .6rem;
}
.meteo-ville {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  text-align: left;
}
.meteo-description {
  color: var(--muted);
  font-size: .95rem;
  text-align: left;
  margin-top: .25rem;
}
.meteo-header-droite {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
}
.meteo-icone { width: 80px; height: 80px; }

.etoile-btn {
  background: none;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  color: #888;
  padding: 0;
  width: auto;
  line-height: 1;
  transition: color .2s, transform .15s;
}
.etoile-btn:hover { color: #fbbf24; transform: scale(1.2); }
.etoile-btn.actif { color: #fbbf24; }

.meteo-temp-principale {
  font-size: 4rem;
  font-weight: 800;
  color: var(--text);
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  margin: .6rem 0 .25rem 0;
}
.meteo-ressenti {
  color: var(--muted);
  font-size: .95rem;
  margin-bottom: 1.5rem;
}
.meteo-grille {
  display: flex;
  justify-content: space-around;
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 1.25rem;
  margin-top: .6rem;
}
.meteo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
}
.meteo-label {
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.meteo-valeur { color: var(--text); font-size: 1.1rem; font-weight: 700; }

/* Favoris */
.favoris-liste {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.favori-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .75rem;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
}
.favori-nom {
  flex: 1;
  color: #fbbf24;
  text-decoration: none;
  font-size: .95rem;
  font-weight: 700;
}
.favori-nom:hover { text-decoration: underline; }
.favori-date {
  color: var(--muted);
  font-size: .75rem;
  font-family: monospace;
}
.favori-supprimer {
  background: none;
  border: none;
  color: #888;
  font-size: .9rem;
  cursor: pointer;
  padding: .15rem .4rem;
  width: auto;
  border-radius: 4px;
}
.favori-supprimer:hover { color: var(--red); background: rgba(220,38,38,0.2); }

/* Villes récentes (pastilles) */
.historique-villes {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.historique-btn {
  color: var(--text);
  text-decoration: none;
  background: rgba(167,139,250,0.18);
  border: 1px solid rgba(167,139,250,0.5);
  border-radius: 2rem;
  padding: .35rem .9rem;
  font-size: .85rem;
  transition: background .15s;
}
.historique-btn:hover {
  background: rgba(167,139,250,0.35);
  color: #fff;
}
