/* ================= Base ================= */
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f9f9f9; color: #333;
  padding-top: 64px; /* espace pour la barre fixe */
}

/* ============ MENU HORIZONTAL FIXE ============ */
.menu {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: #222; color: #eee; border-bottom: 1px solid #1a1a1a;
  padding: 0 16px;
}
.menu-inner {
  height: 56px; max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px;
}
.menu-logo img { height: 40px; width: auto; display: block; }

/* Liens (desktop) */
.menu-list {
  list-style: none; margin: 0 0 0 auto; padding: 0;
  display: flex; align-items: center; gap: 6px;
}
.menu-list li { margin: 0; }
.menu-list a {
  display: block; color: #ddd; text-decoration: none;
  padding: 10px 12px; border-radius: 8px; transition: background .2s, color .2s;
}
.menu-list a:hover { background: #333; color: #fff; }
.menu-list a.active { background: #0d6efd; color: #fff; }

/* Bouton burger (mobile) */
.menu-toggle {
  display: none; margin-left: auto;
  background: transparent; color: #eee;
  border: 1px solid #444; border-radius: 6px;
  padding: .35rem .6rem; font-size: 1.1rem; cursor: pointer;
}

/* ============== CONTENU ============== */
.content { max-width: 1000px; margin: 20px auto; padding: 0 16px; }

/* Cartes / Formulaires sobres */
.card {
  background: #fff; border: 1px solid #e6e6e6; border-radius: 10px;
  padding: 1rem; margin-bottom: 1rem;
}
label { display: block; margin-bottom: .35rem; font-weight: 500; }
input, select, textarea, button, .form-select {
  width: 100%; padding: .5rem .6rem; margin-bottom: .8rem;
  border: 1px solid #ccc; border-radius: 6px; font: inherit; line-height: 1.25;
}

/* ======= Selects : desktop sobre par défaut ======= */
select, .form-select {
  -webkit-appearance: menulist;
  -moz-appearance: menulist;
  appearance: menulist;
  background: none !important;
  background-image: none !important;
  padding-right: .75rem;
}

/* ======= Grilles (par défaut = pile, desktop = horizontal) ======= */
.settings-grid {            /* what to display + refresh */
  display: grid;
  gap: 32px;
}
.source-layout {            /* source à gauche → panneau à droite */
  display: grid;
  gap: 32px;
}
.source-layout .source-col { min-width: 220px; }
.source-layout .panel-col .panel + .panel { margin-top: 8px; }
.muted-box {
  background: #f6f6f6; border: 1px dashed #ddd; border-radius: 8px;
  padding: .75rem; color: #666;
}

/* ======= Desktop (≥992px) : disposition horizontale ======= */
@media (min-width: 992px) {
  .settings-grid {
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }
  .source-layout {
    grid-template-columns: 260px 1fr;
    align-items: start;
  }
}

/* ================= RESPONSIVE (≤991px) ================= */
@media (max-width: 991px) {

  body.menu-open { overflow: hidden; }

  /* bouton visible */
  .menu-toggle { display: inline-block; }

  /* la liste se déroule sous la barre */
  .menu-list {
    position: absolute; left: 0; right: 0; top: 64px;
    background: #222; border-bottom: 1px solid #1a1a1a;
    display: none; flex-direction: column; gap: 0; padding: 8px;
  }
  .menu-list.open { display: flex; }
  .menu-list a { padding: 12px 16px; border-radius: 6px; }

  /* Mobile : vrai rendu natif + évite zoom iOS */
  select, .form-select {
    all: unset;                   /* retire tout style hérité (y compris Bootstrap) */
    display: block;
    width: 100%;
    box-sizing: border-box;
    font: 16px system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; /* anti-zoom iOS */
    line-height: 1.3;
    padding: .55rem .65rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    -webkit-appearance: menulist;
    appearance: menulist;
    background: none !important;
    background-image: none !important;
  }
}

/* ============== Boutons & alertes ============== */
button, .btn { cursor: pointer; }
.btn-dark {
  background: #222;
  border: 1px solid #222;
  color: #fff;
  padding: 1rem 2rem;   /* augmente la hauteur et largeur */
  font-size: 1.2rem;    /* texte un peu plus grand */
  border-radius: 8px;   /* optionnel, arrondi plus marqué */
}
.btn-dark:hover { background: #111; border-color: #111; }
.alert { border-radius: 8px; }
.alert-success { background:#d4edda; border:1px solid #c3e6cb; color:#155724; }

.btn-save {
  background: #0d6efd;
  border: 1px solid #0d6efd;
  color: #fff;                  /* texte blanc toujours */
  padding: 1.2rem 2.5rem;       /* plus haut et large */
  font-size: 1.3rem;
  border-radius: 8px;
  display: inline-block;
  text-align: center;
  width: 100%;                  /* optionnel : bouton large */
}
.btn-save:hover {
  background: #0b5ed7;          /* bleu foncé au hover */
  border-color: #0a58ca;
  color: #fff;                  /* reste blanc */
}



/* === Sélecteur "Display" avec icône à gauche === */
.display-picker {
  display: flex;
  align-items: center;
  gap: 20px;           /* espace icône / select */
  margin-bottom: 12px; /* garde un peu d’air sous la ligne */
}

.display-picker .display-icon {
  height: 50px;        /* petit pictogramme */
  width: auto;
  flex: 0 0 auto;      /* ne pas s’étirer */
  opacity: .9;         /* discret */
}

.display-picker .form-select,
.display-picker select {
  flex: 1;             /* le select prend le reste de la largeur */
  margin: 0;           /* pas de marge parasite */
  min-height: 40px;    /* cohérent avec l’icône */
  line-height: 1.2;
}

@media (max-width: 991px) {
  .display-picker { gap: 8px; }
  .display-picker .display-icon { height: 18px; }
}


.visually-hidden{
  position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;
}

/* même logique que le dashboard */
.content--narrow {
  max-width: 840px;
  margin: 40px auto;
  padding: 0 16px;
}

/* grille 2 colonnes sur desktop, 1 colonne sur mobile */
.form-two {
  display: grid;
  gap: 32px;             /* base (mobile/tablette) */
  margin-bottom: 1rem;   /* espace sous la ligne */
}
@media (min-width: 992px) {
  .form-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));  /* évite les débords */
    column-gap: 32px;                                  /* même respiration que dashboard */
    align-items: end;
  }
}

.form-two > div { min-width: 0; }


/* 1) Textarea plus compacte */
textarea#text {
  min-height: 80px;     /* + bas que 80px */
  line-height: 1.3;
  resize: vertical;
}



/* Assure que les champs n'élargissent pas la colonne */
.card input[type="text"],
.card select,
.card textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}


/* bouton cohérent avec ton style “bleu sélection” */
.card .btn {
  background: #0d6efd;
  border: 1px solid #0d6efd;
  color: #fff;
  padding: 0.9rem 1.4rem;
  border-radius: 8px;
}
.card .btn:hover {
  background: #0b5ed7;
  border-color: #0a58ca;
}


#results .card {
  padding: .75rem .9rem;
  border-radius: 8px;
}
#results .card .small { color: #666; }


.menu .menu-list { z-index: 1001; }



/* ===== Mise en page du header : logo | centre | profil ===== */
.menu-inner{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  height:72px;
  gap:12px;
}

/* Icônes blanches */
.menu, .menu * svg { color:#fff; }

/* Liste centrée */
.menu-list{
  list-style:none; margin:0; padding:0;
  display:flex; align-items:center; justify-content:center; gap:6px;
}
.menu-list a{
  display:inline-flex; align-items:center; gap:8px;
  color:#ddd; text-decoration:none;
  padding:10px 12px; border-radius:10px;
  transition:background .2s, color .2s;
}
.menu-list a .mi svg{ width:18px; height:18px; display:block; opacity:.95; }
.menu-list a:hover{ background:#333; color:#fff; }
.menu-list a.active{ background:#0d6efd; color:#fff; }

/* Profil à droite */
.menu-profile{ display:inline-flex; align-items:center; gap:10px; }
.menu-profile .profile-link{
  display:inline-flex; align-items:center; gap:10px;
  color:#eee; text-decoration:none; padding:8px 10px; border-radius:10px;
}
.menu-profile .profile-link:hover{ background:#333; color:#fff; }
.menu-profile .user-icon svg{ width:18px; height:18px; opacity:.9; }

.menu-profile .avatar{
  width:34px; height:34px; border-radius:8px; /* carré arrondi */
  background:#444; color:#fff; display:inline-flex; align-items:center; justify-content:center;
  font-weight:700; font-size:12px; letter-spacing:.5px; border:1px solid #555;
}
.menu-profile .user-name{
  max-width:180px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  font-size:14px; color:#eee;
}
.menu-profile .logout{
  display:inline-flex; align-items:center; justify-content:center;
  width:36px; height:36px; border-radius:10px; color:#eee; text-decoration:none;
  border:1px solid #444;
}
.menu-profile .logout:hover{ background:#333; }
.menu-profile .logout svg{ width:18px; height:18px; }

/* Mobile */
@media (max-width: 991px){
  .menu-toggle{ display:inline-block; margin-left:auto; background:transparent; color:#eee;
    border:1px solid #444; border-radius:6px; padding:.35rem .6rem; font-size:1.1rem; cursor:pointer;}
  .menu-list{
    position:absolute; left:0; right:0; top:72px;
    background:#222; border-bottom:1px solid #1a1a1a;
    display:none; flex-direction:column; gap:4px; padding:8px; z-index:1001;
  }
  .menu-list.open{ display:flex; }
  .menu-list a{ padding:12px 14px; border-radius:8px; }
  .menu-profile .user-name{ display:none; } /* compact */
}



/* ---- PATCH MOBILE MENU (colle ça après tes règles) ---- */

/* Empêche l’auto-zoom du texte sur iOS/Android */
html{ -webkit-text-size-adjust:100%; text-size-adjust:100%; }

/* Variables tailles */
:root{
  --menu-h-desktop:56px;
  --menu-h-mobile:56px;
  --menu-logo-h-desktop:32px;
  --menu-logo-h-mobile:22px;
  --menu-font-desktop:14.5px;
  --menu-font-mobile:13px;
  --menu-icon-desktop:18px;
  --menu-icon-mobile:16px;
}

/* Branche les variables */
.menu-inner{ height: var(--menu-h-desktop); }
.menu-logo img{ height: var(--menu-logo-h-desktop); }
.menu{ font-size: var(--menu-font-desktop); }
.menu-list a .mi svg,
.menu-profile .user-icon svg,
.menu-profile .logout svg{ width: var(--menu-icon-desktop); height: var(--menu-icon-desktop); }

/* Avatar/Logout légèrement + petits (desktop aussi) */
.menu-profile .avatar{ width:30px; height:30px; font-size:11px; }
.menu-profile .logout{ width:32px; height:32px; }

/* ====== Mobile ====== */
@media (max-width: 991px){
  /* Compacter globalement */
  body{ padding-top: var(--menu-h-mobile); }
  .menu-inner{ height: var(--menu-h-mobile); gap:8px; }
  .menu{ font-size: var(--menu-font-mobile); }
  .menu-logo img{ height: var(--menu-logo-h-mobile); }

  /* Bouton burger plus discret */
  .menu-toggle{
    padding:.3rem .5rem; font-size:1rem; border-radius:6px;
  }

  /* Liens plus petits et moins paddés */
  .menu-list a{
    padding:10px 12px; border-radius:8px;
  }

  /* Icônes + petites */
  .menu-list a .mi svg,
  .menu-profile .user-icon svg,
  .menu-profile .logout svg{
    width: var(--menu-icon-mobile); height: var(--menu-icon-mobile);
  }

  /* Avatar/profile compacts */
  .menu-profile{ gap:8px; }
  .menu-profile .avatar{ width:26px; height:26px; font-size:10px; border-radius:7px; }
  .menu-profile .user-name{ display:none; } /* on garde juste avatar + picto */
  .menu-profile .logout{ width:28px; height:28px; border-radius:8px; }

  /* Le panneau déroulant commence pile sous la barre mobile */
  .menu-list{
    top: var(--menu-h-mobile);
    gap:2px; padding:6px 8px;
  }
}

/* Patch iOS : empêche l’agrandissement automatique du texte */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}


/* ==== Suggestions de ville (chips) ==== */
#city-preview { min-height: 36px; }

/* conteneur des chips */
.city-suggestions{
  display:flex;
  flex-wrap:wrap;
  gap:.4rem;
  margin-top:.35rem;
}

/* puces/chips */
.city-suggest{
  appearance:none;
  border:1px solid #dcdcdc;
  background:#fff;
  color:#333;
  padding:.35rem .6rem;
  border-radius:999px;
  font-size:.85rem;
  line-height:1;
  cursor:pointer;
  box-shadow:0 1px 0 rgba(0,0,0,.02);
  transition:background .15s, border-color .15s, box-shadow .15s, transform .02s;
  display:inline-flex;
  align-items:baseline;
  gap:.35rem;
}

.city-suggest:hover{ background:#f7f7f7; border-color:#cfcfcf; }
.city-suggest:active{ transform:translateY(1px); }

.city-suggest:focus-visible{
  outline:none;
  box-shadow:0 0 0 3px rgba(13,110,253,.15);
  border-color:#9cc3ff;
}

/* libellé / coords plus discrètes, chiffres alignés */
.city-suggest .cs-label{ font-weight:500; }
.city-suggest .cs-coords{
  color:#6a6a6a;
  font-variant-numeric: tabular-nums;
  letter-spacing:.1px;
}

/* petit picto devant le libellé (optionnel) */
.city-suggest::before{
  content:"📍";
  margin-right:.25rem;
  opacity:.8;
}

.city-suggest:hover{ background:#eef4ff; border-color:#b6d2ff; }


/* ligne de résultat “meilleur match” */
.city-best{
  display:flex; align-items:center; gap:.5rem;
}
.city-best .coords{ color:#666; font-variant-numeric: tabular-nums; }



/* thème sombre (si jamais) */
@media (prefers-color-scheme: dark){
  .city-suggest{ background:#1f1f1f; color:#e8e8e8; border-color:#3a3a3a; }
  .city-suggest:hover{ background:#262626; border-color:#4a4a4a; }
  .city-suggest .cs-coords{ color:#b6b6b6; }
  .city-best .coords{ color:#bbb; }
}


