/* =========================
   BB.css — Bottom Bar & Context Bar
   Indépendant des autres CSS
   ========================= */

/* Par défaut : rien n’apparaît en desktop/tablette */
.GM-bottomNavShell {
  display: none;
}

/* Icônes images de la bottom bar (taille fixe, pas de zoom) */
.GM-bottomNav-imgIcon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
}

/* Vue mobile uniquement */
@media (max-width: 768px) {

  /* On masque l'ancien bouton IA où qu'il soit */
  [data-gm-ai-launcher] {
    display: none !important;
  }

  /* On masque le footer global */
  #site-footer {
    display: none !important;
  }

  /* On évite que le contenu soit caché sous la double barre */
  body {
    padding-bottom: 152px;
  }

  .GM-bottomNavShell {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1150;
    font-family: inherit;
  }

  /* ============================
     BARRE CONTEXTUELLE (cachée par défaut)
     ============================ */

  .GM-bottomContext {
    display: flex;
    align-items: center;
    gap: 10px;

    /* état replié par défaut */
    max-height: 0;
    opacity: 0;
    padding: 0 14px 0;
    border-top: none;
    pointer-events: none;

    /* BLEU DU HEADER */
    background: #20466e;
    color: #e2e8f0;

    overflow-x: auto;
    -webkit-overflow-scrolling: touch;

    transition:
      max-height 0.18s ease-out,
      opacity 0.18s ease-out,
      padding 0.18s ease-out,
      border-top-color 0.18s ease-out;
  }

  /* Quand on a du contexte, le shell reçoit .has-context et la barre se “lève” */
  .GM-bottomNavShell.has-context .GM-bottomContext {
    max-height: 140px;
    opacity: 1;
    padding: 10px 14px 6px;
    border-top: 1px solid rgba(255,255,255,0.08);
    pointer-events: auto;

    background: #20466e;
  }

  .GM-ctxBtn {
    flex: 0 0 auto;
    padding: 10px 10px;
    border-radius: 999px;
    border: 1px solid rgba(203,213,225,0.35);
    background: rgba(255,255,255,0.06);
    color: #f1f5f9;
    font-size: 16px;
    line-height: 1.15;
    white-space: nowrap;
  }

  .GM-ctxBtn:active {
    background: rgba(56,189,248,0.25);
    border-color: rgba(56,189,248,0.5);
  }

  /* ============================
     BARRE PRINCIPALE (NAV)
     ============================ */
  .GM-bottomNav {
    display: flex;
    justify-content: space-around;

    background: #20466e;
    color: #ffffff;
    padding: 2px 0 6px;
    border-top: none;
  }

  .GM-bottomNav-btn {
    flex: 1 1 0;
    border: none;
    background: none;
    color: inherit;
    padding: 6px 4px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    font-size: 12px;
  }

  /* Conteneur d’icône : base pour le halo */
  .GM-bottomNav-btnIcon {
    font-size: 24px;
    line-height: 1;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Texte explicatif sous les icônes : masqué */
  .GM-bottomNav-btnLabel {
    display: none;
  }

  /* Bouton actif : le halo fait le job, on garde le blanc */
  .GM-bottomNav-btn.is-active {
    color: #ffffff;
  }

  /* Halo ORANGE autour de l’icône active */
  .GM-bottomNav-btn.is-active .GM-bottomNav-btnIcon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 54px;   /* un peu plus grand que l’icône (36px) */
    height: 54px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(255, 165, 0, 0.45); /* halo orange */
    filter: blur(10px);
    z-index: 0;
    animation: gmHaloPop 0.18s ease-out;
  }

  @keyframes gmHaloPop {
    from {
      opacity: 0;
      transform: translate(-50%, -50%) scale(0.7);
    }
    to {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }
  }

  /* ============================
     BOUTON IA FLOTTANT
     ============================ */

  /* Position par défaut : très proche au-dessus de la bottom bar */
  .GM-iaBtnWrapper {
    position: fixed;
    right: 16px;
    bottom: 72px; /* rapproché de la bottom bar */
    z-index: 1500;
    transition: bottom 0.25s ease-out;
  }

  .GM-iaBtn {
    border: none;
    border-radius: 999px;
    width: 48px;
    height: 48px;
    background: #20466e;      /* même bleu que la bottom bar */
    color: #ffffff;           /* point d’interrogation blanc */
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(15,23,42,.35);
    cursor: pointer;
  }

  .GM-iaBtn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(15,23,42,.3);
  }

  .GM-iaBtn-icon {
    font-size: 28px;
    transform: translateY(-1px); /* léger recentrage visuel */
  }

  .GM-iaBtn-label {
    font-size: 13px;
  }

  .GM-iaBtn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(15,23,42,.3);
  }

  /* Quand la context bar est ouverte, on remonte le bouton IA
     en gardant un gap similaire à celui avec la bottom bar seule */
  .GM-bottomNavShell.has-context ~ .GM-iaBtnWrapper {
    bottom: 140px;
  }
}

/* ==========================================================
   GM-joinHint — Bulle d’aide / confirmation d’inscription
   Associée à la bottom bar (événements)
   ========================================================== */

@media (max-width: 768px) {
  .GM-joinHint {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 78px; /* juste au-dessus de la bottom bar */
    z-index: 1200;
    pointer-events: auto;
    display: none;
  }

  .GM-joinHint.is-visible {
    display: block;
  }

  .GM-joinHint-inner {
    position: relative;

    /* 🟦 Nouveau : bulle claire */
    background: #f3f4f6;          /* gris clair */
    color: #111827;               /* gris très foncé (lisible) */

    padding: 14px 16px 12px;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);

    display: flex;
    flex-direction: column;       /* 🆕 texte en haut / boutons en bas */
    gap: 12px;

    max-width: min(340px, 94vw);
    font-size: 0.95rem;
    line-height: 1.35;
  }

  /* petit triangle orienté vers la bottom bar */
  .GM-joinHint-inner::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%);
    border-width: 8px 8px 0 8px;
    border-style: solid;

    /* 🟦 nouveau : triangle gris clair */
    border-color: #f3f4f6 transparent transparent transparent;
  }

  .GM-joinHint-text {
    flex: 1 1 auto;
    font-weight: 500;
  }

  /* Zone contenant les boutons */
  .GM-joinHint-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
  }

  .GM-joinHint-btn {
    border: none;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    background: #e5e7eb;          /* gris doux */
    color: #111827;
    white-space: nowrap;
  }

  .GM-joinHint-btn.GM-joinHint-confirm {
    background: #22c55e;          /* vert OK */
    color: #022c22;
    font-weight: 600;
  }
}

/* version desktop (rarement utile mais propre) */
@media (min-width: 769px) {
  .GM-joinHint {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 24px;
    z-index: 1200;
    pointer-events: auto;
    display: none;
  }

  .GM-joinHint.is-visible {
    display: block;
  }
}

/* ===========================================
   Agrandissement x2 du bouton "Je participe"
   uniquement sur page évènement
   =========================================== */
@media (max-width: 768px) {
  .GM-bottomNavShell[data-gm-page-kind="event"]
    .GM-bottomNav-btn[data-gm-nav="event_join"]
    .GM-bottomNav-btnIcon {

      transform: scale(2);
      transform-origin: center;
  }
}
@media (max-width: 768px) {
  html, body {
    background: #20466e;
  }
}
/* Profil : par défaut, on cache le bouton "Retour" */
@media (max-width: 768px) {
  .GM-profileBackBtn {
    display: none;
  }
}
/* Par défaut, on cache le bouton Retour */
.GM-profileBackBtn {
  display: none;
}

/* Le bouton MOI reste visible par défaut */
.GM-profileMeBtn {
  display: inline-flex;
}
