/*
  header-menu.css — MadaPayExchange
  -----------------------------------------------------------------------
  Style du bouton "menu" unique qui remplace le badge texte "Compte
  vérifié" dans l'en-tête, et du panneau déroulant qui regroupe toutes les
  icônes déjà existantes (cloche, sécurité, mobile money, thème, statut,
  historique, taux) au même endroit — avec une animation "slide" à
  l'ouverture/fermeture.

  v2 — ajouts (100% additifs, aucune règle existante modifiée) : style de
  la liste des 4 nouveaux raccourcis (Solde rapide / Services favoris /
  Aide-FAQ / Calculatrice de conversion) et des petites fenêtres qu'ils
  ouvrent (elles réutilisent .simple-modal / .simple-modal-box / .btn déjà
  définies dans style.css — aucune de ces classes n'est redéfinie ici).

  Fichier 100% additif : aucune règle de style.css n'est modifiée ou
  redéfinie ici (nouvelles classes préfixées "mp-header-menu" / "mp-qa-").

  Propriété intellectuelle : conçu et développé par HJ.
*/

/* ----- Bouton toggle, même gabarit que .nav-icon-btn (cadenas / carte) ----- */
.mp-header-menu-btn {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #121a24;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  color: #eef2f5;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}
.mp-header-menu-btn:hover { transform: scale(1.08); }
.mp-header-menu-btn svg { width: 16px; height: 16px; transition: transform 0.25s ease; }

.mp-header-menu-btn.mp-open {
  background: var(--green-dim, rgba(0, 217, 126, 0.15));
  border-color: var(--green, #00d97e);
  color: var(--green, #00d97e);
}
.mp-header-menu-btn.mp-open svg { transform: rotate(90deg); }

/* Petit point d'alerte sur le bouton menu lui-même (repris de la logique
   déjà existante sur l'icône Historique : s'allume si une des icônes
   regroupées à l'intérieur a quelque chose à signaler). */
.mp-header-menu-btn .mp-header-menu-dot {
  display: none;
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber, #f5a623);
  box-shadow: 0 0 0 2px #0b0f14;
}
.mp-header-menu-btn.mp-has-alert .mp-header-menu-dot { display: block; }

/* ----- Panneau déroulant ----- */
.mp-header-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 240px;
  max-width: min(320px, 90vw);
  background: #121a24;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  padding: 12px;
  z-index: 60;

  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;

  /* État fermé : animation "slide" douce (hauteur + fondu + léger décalage) */
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-8px);
  pointer-events: none;
  transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.22s ease,
              transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.32s ease;
}

.mp-header-menu-panel.mp-open {
  /* Assez de hauteur pour les icônes existantes + les 4 nouveaux
     raccourcis ; défile si l'écran est très petit. */
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding-top: 12px;
  padding-bottom: 12px;
  padding-right: 8px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;

  /* Barre de défilement fine et discrète (au lieu de la barre grise par
     défaut du navigateur), assortie aux couleurs du site. */
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 217, 126, 0.45) transparent;
}
.mp-header-menu-panel.mp-open::-webkit-scrollbar { width: 5px; }
.mp-header-menu-panel.mp-open::-webkit-scrollbar-track { background: transparent; }
.mp-header-menu-panel.mp-open::-webkit-scrollbar-thumb {
  background: rgba(0, 217, 126, 0.45);
  border-radius: 10px;
}
.mp-header-menu-panel.mp-open::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 217, 126, 0.75);
}

/* Icônes déjà existantes (statut / historique / taux) : v2, affichées en
   liste (icône + texte), au même gabarit que "Plus d'options" ci-dessous —
   au lieu de simples icônes sans texte côte à côte. */
.mp-header-menu-icons {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* La ligne elle-même reprend .mp-qa-item (voir plus bas) ; ici on adapte
   seulement l'icône d'origine (.nav-icon-btn / .nav-status-dot) pour
   qu'elle se fonde dans le rond "icône" au lieu de garder son propre
   cercle/fond (sinon on aurait un cercle dans un cercle). */
.mp-header-native-icon .nav-icon-btn {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  box-shadow: none;
  margin: 0;
  color: var(--green, #00d97e);
}
.mp-header-native-icon .nav-icon-btn:hover { transform: none; }
/* La pastille "Connecté" (point vert) garde sa taille d'origine, juste
   centrée dans le rond "icône". */
.mp-header-native-icon .nav-status-dot {
  width: 14px;
  height: 14px;
  background: rgba(0, 217, 126, 0.15);
}

/* Conteneur positionnant relatif, pour ancrer le panneau sous le bouton */
.mp-header-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Petite étiquette au-dessus des icônes regroupées, purement indicative */
.mp-header-menu-label {
  width: 100%;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #9aa4b2);
  margin-bottom: 2px;
}

/* Séparateur fin entre la rangée d'icônes et les nouveaux raccourcis */
.mp-header-menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 0 2px;
}

/* ===== v2 : liste des 4 nouveaux raccourcis ===== */
.mp-header-menu-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mp-qa-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 8px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: #eef2f5;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.mp-qa-item:hover,
.mp-qa-item:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.mp-qa-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0b0f14;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green, #00d97e);
  flex: 0 0 auto;
}
.mp-qa-icon svg { width: 15px; height: 15px; }

.mp-qa-text { flex: 1 1 auto; line-height: 1.25; }

/* ===== v2 : contenu des fenêtres ouvertes par les 4 raccourcis =====
   (le cadre lui-même vient de .simple-modal / .simple-modal-box, déjà
   défini dans style.css — non redéfini ici). */
.mp-qa-modal-body {
  max-height: 55vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 217, 126, 0.45) transparent;
}
.mp-qa-modal-body::-webkit-scrollbar { width: 5px; }
.mp-qa-modal-body::-webkit-scrollbar-track { background: transparent; }
.mp-qa-modal-body::-webkit-scrollbar-thumb {
  background: rgba(0, 217, 126, 0.45);
  border-radius: 10px;
}
.mp-qa-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 217, 126, 0.75);
}

/* ----- Solde rapide ----- */
.mp-wallet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  font-size: 13.5px;
}
.mp-wallet-row:last-of-type { border-bottom: none; }
.mp-wallet-method { color: var(--muted, #9aa4b2); }
.mp-wallet-amount { font-weight: 700; }
.mp-wallet-pending {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--muted, #9aa4b2);
}

/* ----- Services favoris ----- */
.mp-fav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}
.mp-fav-row:last-of-type { border-bottom: none; }
.mp-fav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text, #e7ecef);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  flex: 1 1 auto;
  min-width: 0;
}
.mp-fav-link:hover { color: var(--green, #00d97e); }
.mp-fav-logo { width: 22px; height: 22px; border-radius: 50%; object-fit: contain; background: #fff; flex: 0 0 auto; }
.mp-fav-star {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
  color: var(--muted, #9aa4b2);
  padding: 4px;
  flex: 0 0 auto;
}
.mp-fav-star-active { color: var(--amber, #f5a623); }

/* ----- Aide / FAQ ----- */
.mp-faq-item {
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}
.mp-faq-item:last-of-type { border-bottom: none; }
.mp-faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  background: none;
  border: none;
  color: var(--text, #e7ecef);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.mp-faq-caret { transition: transform 0.2s ease; color: var(--muted, #9aa4b2); }
.mp-faq-q-open .mp-faq-caret { transform: rotate(90deg); color: var(--green, #00d97e); }
.mp-faq-a {
  display: none;
  padding: 0 0 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted, #9aa4b2);
}
.mp-faq-a-open { display: block; }

/* ----- Calculatrice de conversion ----- */
.mp-conv-field { margin-bottom: 12px; }
.mp-conv-field label {
  display: block;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted, #9aa4b2);
  margin-bottom: 5px;
}
.mp-conv-field select,
.mp-conv-field input {
  width: 100%;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.14));
  background: var(--card-2, #0b0f14);
  color: var(--text, #e7ecef);
  font-family: inherit;
  font-size: 13.5px;
}
.mp-conv-result {
  margin-top: 4px;
  padding: 12px;
  border-radius: 10px;
  background: var(--green-dim, rgba(0, 217, 126, 0.12));
  border: 1px solid var(--green, #00d97e);
  color: var(--green, #00d97e);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  word-break: break-word;
}

/* ----- QR Code ----- */
.mp-qr-image-wrap {
  display: flex;
  justify-content: center;
  margin: 4px 0 12px;
}
.mp-qr-image-wrap img {
  width: 180px;
  height: 180px;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}
.mp-qr-link {
  font-size: 12px;
  color: var(--muted, #9aa4b2);
  text-align: center;
  word-break: break-all;
}

@media (max-width: 480px) {
  .mp-header-menu-btn { width: 28px; height: 28px; }
  .mp-header-menu-btn svg { width: 14px; height: 14px; }
  .mp-header-menu-panel { right: -8px; }
}


/* ===== v3 — icônes déplacées dans le menu : accueil, cloche, cadenas,
   carte Mobile Money. Elles gardent leur élément d'origine (écouteurs
   intacts) ; on neutralise seulement leur style "bouton rond flottant"
   (dont certains sont posés en inline par client-header.js) pour qu'elles
   se fondent dans le rond .mp-qa-icon, comme les autres lignes. ===== */
.mp-header-native-icon > #navHomeBtn,
.mp-header-native-icon > #mp-notif-bell,
.mp-header-native-icon > #headerSecurityBtn,
.mp-header-native-icon > #headerMobileMoneyBtn {
  position: relative !important;
  right: auto !important;
  bottom: auto !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  transform: none !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: var(--green, #00d97e);
  text-decoration: none;
}
.mp-header-native-icon > #mp-notif-bell svg { color: var(--green, #00d97e); }
.mp-header-native-icon > #headerSecurityBtn,
.mp-header-native-icon > #headerMobileMoneyBtn { font-size: 14px !important; }

/* La cloche n'apparaît dans l'en-tête que s'il y a des annonces
   (.mp-notif-show, géré par notif-widget.js) : on garde ce comportement
   en masquant toute la ligne du menu tant que la cloche est cachée. */
.mp-header-native-row:has(#mp-notif-bell:not(.mp-notif-show)) { display: none; }

/* Pastille rouge du nombre d'annonces : recalée sur le petit rond. */
.mp-header-native-icon #mp-notif-bell-badge { top: -4px; right: -4px; }
