/* 🌌 Météorite v3 — effet Liquid Glass façon Apple */

:root {
  --bg: #0f1222;
  --text: #e9ecff;
  --public-text: #0b1220; /* texte foncé pour le main public */
  --muted: #aab1d7;
  --accent: #7aa2ff;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);

  /* effet verre liquide */
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.25);
  --glass-highlight: rgba(255, 255, 255, 0.4);
  --glass-blur: 30px;
  --glass-sat: 160%;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial;
  background: radial-gradient(1200px 800px at 10% -10%, #1d2347 0%, var(--bg) 50%) fixed, var(--bg);
  color: var(--text);
  line-height: 1.4;
  overflow-x: hidden;
}
.nav-logo img {
  height: 1.4em;
  vertical-align: middle;
}


h1 img {
  height: 1.8em;
  vertical-align: middle;
}

.app-navbar {
  position: sticky;
  top: 0;
  z-index: 2000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
/* Overlay pour menu mobile */
.nav-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease; z-index: 900; }
.nav-overlay.show { opacity: 1; visibility: visible; }

.nav-logo a {
  text-decoration: none;
  font-weight: 600;
  color: var(--text);
  font-size: 1.3rem;
}

/* Swiper 24h — factorisé */
.hourly-container, .daily-container { position: relative; width: 100%; padding: 0 40px; margin: 0 -4px; }
.scroll-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 10; background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--text); backdrop-filter: blur(4px); border-radius: 50%; width: 36px; height: 36px; font-size: 1rem; cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.scroll-btn:hover { background: rgba(180, 180, 180, 0.3); transform: translateY(-50%) scale(1.05); }
#scroll-left, #daily-scroll-left { left: 4px; }
#scroll-right, #daily-scroll-right { right: 4px; }

.hourly { display: grid; grid-auto-flow: column; grid-auto-columns: 90px; gap: 10px; margin-top: 12px; padding: 10px 4px; overflow-x: auto; scroll-behavior: smooth; -ms-overflow-style: none; scrollbar-width: none; }
.hourly::-webkit-scrollbar { display: none; }

/* --- Liens principaux --- */
.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}
.nav-item {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.25s, transform 0.25s;
}
.nav-item:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

/* --- Auth Desktop --- */
.nav-auth {
  display: flex;
  gap: 10px;
}
.nav-button {
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--glass-border);
  padding: 6px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.08);
  transition: all 0.25s ease;
  font-weight: 500;
}
.nav-button:hover {
  background: rgba(255,255,255,0.18);
}
.nav-button.accent {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.nav-button.accent:hover {
  filter: brightness(1.1);
}

/* --- Bouton mobile --- */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text);
  cursor: pointer;
}

/* --- Menu Mobile --- */
@media (max-width: 780px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 70px;
    right: 16px;
    background: rgba(0,0,0,0.45);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 16px;
    width: 200px;
    backdrop-filter: blur(calc(var(--glass-blur) / 1.5)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(calc(var(--glass-blur) / 1.5)) saturate(var(--glass-sat));
    z-index: 1000;
    animation: fadeIn 0.3s ease;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-item {
    color: var(--text);
    padding: 8px 0;
    text-align: right;
  }
  .nav-auth {
    display: none;
  }
  .nav-auth-mobile {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
  }
  .nav-toggle {
    display: block;
  }
}

/* --- Animation --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive --- */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text);
  cursor: pointer;
}
@media (max-width: 780px) {
  .nav-links, .nav-auth {
    display: none;
  }
  .nav-toggle {
    display: block;
  }
}

/* HEADER */
.app-header {
  padding: clamp(16px, 3vw, 32px);
  text-align: center;
}
h1 {
  font-size: clamp(28px, 5vw, 44px);
  margin: 0;
}
.tagline {
  margin: 0.25rem 0 1rem;
  color: var(--muted);
}

/* --- Centre uniquement le main public de la page d'accueil --- */
#public-main {
  display: flex;
  flex-direction: column;
  align-items: center; /* centre horizontalement */
  gap: 24px;
  padding: 24px 16px;
  color: var(--public-text);
}

/* RECHERCHE — style Apple glass */
#search-form {
  margin: 0 auto;
  display: flex;
  gap: 8px;
  justify-content: center;
  position: relative;
  max-width: 720px;
}

#search,
#search-form button {
  border-radius: 22px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  color: var(--text);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
}

#search {
  width: min(680px, 90vw);
  padding: 14px 16px;
  outline: none;
  font-size: 1rem;
}
#search::placeholder {
  color: var(--muted);
}
#search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(122, 162, 255, 0.3);
}
#search-form button {
  padding: 0 14px;
  cursor: pointer;
  font-size: 1.2rem;
}
#search-form button:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* SUGGESTIONS */
.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 56px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  margin-top: 8px;
  overflow: hidden;
  display: none;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  z-index: 10;
}
.suggestions.show {
  display: block;
}
.suggestions button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background: transparent;
  color: var(--text);
  border: 0;
  cursor: pointer;
}
.suggestions button:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* CONTENU */
.content {
  max-width: 960px;
  margin: 12px auto 48px;
  padding: 0 16px;
}
.location h2 {
  margin: 0;
  font-size: clamp(20px, 3vw, 28px);
}
.muted {
  color: var(--muted);
}

/* À propos et sections publiques lisibles quel que soit le fond */
.center-content { max-width: 880px; width: 100%; text-align: center; margin: 0 auto; padding: 16px; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 18px; color: var(--text); box-shadow: var(--shadow); backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)); -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)); }
#public-main { display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 24px 16px; color: var(--text); }

/* CARTE PRINCIPALE — verre liquide */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, var(--glass-highlight), transparent 60%);
  opacity: 0.15;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5);
}

/* Sections de prévisions */
.forecast, .forecast-daily {
  margin-top: 24px;
}

.forecast h3, .forecast-daily h3 {
  margin-bottom: 16px;
  font-size: 1.2rem;
}

/* (déjà factorisé plus haut) */

/* Détails météo */
.current-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.current-temp {
  font-size: clamp(40px, 8vw, 72px);
  font-weight: 700;
}
.current-desc {
  color: var(--muted);
  margin-top: 4px;
}
.current-icon {
  font-size: clamp(48px, 8vw, 80px);
}

/* Petits blocs */
.current-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.current-grid div {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(20px) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(20px) saturate(var(--glass-sat));
}
.updated {
  margin: 12px 4px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* (déjà factorisé plus haut) */

.hour {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 10px;
  text-align: center;
  backdrop-filter: blur(20px) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(20px) saturate(var(--glass-sat));
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hour:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.hour strong {
  display: block;
  font-size: 1.1rem;
}

.hour .icon {
  font-size: 24px;
  margin: 6px 0;
}

/* Styles des selects */
select {
  background: var(--glass-bg);
  color: var(--text);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
}

select option {
  background: var(--bg);
  color: var(--text);
  padding: 8px;
}

select option:checked,
select option:hover,
select option:focus {
  background: var(--accent);
  color: white;
}

/* (déjà factorisé plus haut) */

/* Daily forecast styles */
.daily {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 110px;
  gap: 12px;
  margin-top: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 10px 4px;
  
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.daily::-webkit-scrollbar {
  display: none;
}

.daily .day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  border-radius: 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  text-align: center;
  gap: 4px;
}

.daily .day .icon {
  font-size: 1.8rem;
  margin: 4px 0;
}

.daily .day .day-name {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
}

.daily .day .temps {
  font-size: 0.9rem;
  font-weight: 500;
}

.daily .day .temps .max {
  font-weight: 700;
  color: var(--text);
}

.daily .day .temps .min {
  color: var(--muted);
  margin-left: 4px;
}

/* État de chargement */
.loading {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* État visible avec transition */
.visible {
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive : masquer les boutons de scroll sur mobile */
@media (max-width: 480px) { .scroll-btn { display: none; } .hourly-container, .daily-container { padding: 0; } .hourly, .daily { padding: 10px 0; } }

/* FOOTER */
.app-footer {
  padding: 32px;
  text-align: center;
  color: var(--muted);
}

/* Accessibilité */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


