/* -------------------------------------------
   mobile-dashboard.css - Mobile Dashboard
-------------------------------------------- */

/* =============================
   1) VARIABLES GLOBALES
============================= */
:root {
  --bg-main: #F2F2F7;             
  --color-primary: #4183FF;       
  --color-text-dark: #333;
  --color-border: #ddd;
  --shadow: 0 2px 6px rgba(0,0,0,0.15);
  --font-family: 'Poppins', 'Helvetica Neue', Arial, sans-serif;
  --font-size-base: 16px;

  --header-height: 85px;          
  --bottom-nav-height: 65px;      
  --actions-bar-height: 55px;     

  /* Effet d’élasticité optionnel pour transitions */
  --ease-out-elastic: cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

:root{
  --wpt-mobile-header-height: 85px;          /* aligne avec --header-height   */
  --wpt-brand-color:        #4183FF;         /* manquaient dans votre feuille */
  --wpt-pastel-2:           #f5f4ff;
  --wpt-shadow-color:       rgba(0,0,0,.15);
  --wpt-text-color:         #333;
}


/* =============================
   2) RESET & BASE
============================= */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
background: transparent !important;
overflow-x: hidden;
}

body {
  /* On neutralise le padding-top iOS */
  padding-top: 0 !important;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-text-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* (Re-déclaration) Variables optionnelles */
:root {
  --header-height: 85px;
  --ease-out-elastic: cubic-bezier(0.25, 1, 0.5, 1); 
}

/* ========================================
   HEADER MOBILE – full-bleed + flex column
======================================== */
.wpt-mobile-header {
    /* espace sous la notch */
  padding-top: env(safe-area-inset-top);
  height: calc(var(--header-height) + env(safe-area-inset-top));
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 999;
  background: linear-gradient(140deg, #4535b9 0%, #8a41c3 60%, #de4ecd 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s var(--ease-out-elastic);
  overflow: visible;
}

/* Pseudo-élément pour prolonger le dégradé sous la notch */
.wpt-mobile-header::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: env(safe-area-inset-top);
  background: inherit;
  z-index: -1;
}

/* Petite vague blanche en bas du header */
.wpt-mobile-header::after {
  content: "";
  position: absolute;
  bottom: -20px;
  left: 0;
  width: 100%;
  height: 20px;
  background: #ffffff;
  z-index: -100;
}

/* Ligne 1 : icône gauche / logo centré / icône droite */
.wpt-mobile-header-inner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: var(--header-height) !important;
  padding: 0 15px !important;
}

.wpt-mobile-header-left,
.wpt-mobile-header-right {
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wpt-mobile-logo {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wpt-mobile-logo img {
  max-height: 48px;
  width: auto;
  object-fit: contain;
}

/* On masque le h1 original si besoin */
.wpt-mobile-title {
  display: none;
}

/* Ligne 2 : petit sous-titre */
.wpt-mobile-subtitle {
  display: block !important;
  width: 100%;
  text-align: center;
  font-size: 0.875rem;
  color: #fff;
  padding: 4px 0;
  background: rgba(0,0,0,0.1);
  margin-top: auto; /* pour coller sous .wpt-mobile-header-inner */
}

/* =============================
   BOUTONS ICÔNES
============================= */
.wpt-header-btn {
  border: none;
  background: none;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background-color 0.2s;
  border-radius: 50%;
}
.wpt-header-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
}
.wpt-header-btn:active {
  transform: scale(0.95);
}
.wpt-header-btn img {
  max-width: 24px;
  max-height: 24px;
  pointer-events: none;
}

/* =============================
   4) BARRE DE CHARGEMENT
============================= */
#wpt-loading-bar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  height: 2px;
  width: 0;
  background: var(--color-primary);
  opacity: 0;
  transition: width 0.3s ease, opacity 0.3s ease;
  z-index: 10000;
}

/* =============================
   5) SUBHEADER / BANDEAU D'ACTIONS (fixe)
============================= */
.wpt-actions-bar {
  position: fixed;
  top: var(--header-height);
  left: 0; right: 0;
  height: 20px; /* ou var(--actions-bar-height) */
  background-color: #edecf8;
  transition: transform 0.4s var(--ease-out-elastic);
  pointer-events: auto;
  margin-top: 25px;
  z-index: -1; /* rendu invisible par défaut => .hidden */
}

.wpt-bar-grip {
  height: 6px;
  width: 40px;
  background: #ccc;
  border-radius: 3px;
  margin: 4px auto;
  opacity: 0.5;
}
.wpt-bar-grip:hover {
  opacity: 0.7;
}

/* Conteneur horizontal scrollable */
.wpt-actions-scroll-container {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  height: auto;
  padding: 0.5rem 1rem;
  position: relative;
  box-sizing: border-box;
  background: #ffffff;
  margin-top: -25px;
  scrollbar-width: none;    
  -ms-overflow-style: none; 
}
.wpt-actions-scroll-container::-webkit-scrollbar {
  display: none;
}
.wpt-actions-scroll-container::after {
  content: "";
  position: fixed;
  top: 0;
  right: 0;
  width: 40px;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(to left, #fff 0%, rgba(255,255,255,0) 100%);
}

/* Boutons subheader */
.wpt-subheader-action-btn {
  display: inline-flex;
  gap: 0.4rem;
  background: #fff;
  color: #555;
  font-size: 0.8rem;
  font-weight: 400;
  padding: 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.2s;
  box-shadow: 0 1px 2px rgb(165 203 255 / 62%);
}
.wpt-subheader-action-btn:hover {
  background: #edf2ff;
  transform: scale(1.03);
  color: #4183FF;
}
.wpt-subheader-action-btn:active {
  transform: scale(0.96);
}

/* =============================
   6) CONTENU PRINCIPAL
============================= */
main#wpt_main_content {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: #fbfcff;
  transition: opacity 0.4s ease, transform 0.4s ease;
  /* La marge haute compense la hauteur du header */
  padding: 140px 5px 120px 5px;
}
.fade-in {
  opacity: 1;
  transform: translateY(0);
}
.fade-out {
  opacity: 0.01;
  transform: translateY(1rem);
}

/* =============================
   VARIABLES GLOBALES Barre Nav
============================= */
:root {
  --bottom-nav-height: 60px;
  --nav-btn-padding-vertical: 0.4rem;
  --nav-btn-padding-horizontal: 0;
  --nav-icon-size: 22px;
  --nav-label-font-size: 0.625rem;
  --nav-label-gap: 6px;
  --nav-btn-radius: 8px;
  --nav-hover-bg: rgba(65,131,255,0.1);
  --nav-active-bg: rgba(65,131,255,0.15);
  --floating-btn-size: 64px;
  --floating-icon-size: 60px;
  --floating-btn-elevation: 0 4px 12px rgba(0,0,0,0.15);
}

/* =============================
   BARRE DE NAV FIXE EN BAS
============================= */
.wpt-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-height);
  background: #f0f0ff;
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -1px 3px rgba(0,0,0,0.1);
  z-index: 9999;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  background: #ffffff;
}

/* BLOC GAUCHE – 4 ICÔNES ÉQUILIBRÉES */
.wpt-nav-left-4icons {
  flex: 1;
}
.wpt-nav-list-4icons {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  height: 100%;
}
.wpt-nav-list-4icons li {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* BOUTONS NAV (ICÔNE + LIBELLÉ) */
.wpt-nav-btn-bottom {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 100%;
  padding: var(--nav-btn-padding-vertical) var(--nav-btn-padding-horizontal);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--nav-label-gap);
  border-radius: var(--nav-btn-radius);
  transition: background-color 0.2s, transform 0.2s, color 0.2s;
  color: #777;
}
.wpt-nav-btn-bottom img {
  width: var(--nav-icon-size);
  height: var(--nav-icon-size);
  display: block;
}
.wpt-nav-btn-bottom span {
  font-size: var(--nav-label-font-size);
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}
.wpt-nav-btn-bottom:hover {
  background-color: var(--nav-hover-bg);
  transform: translateY(-2px);
  color: var(--color-primary);
}
.wpt-nav-btn-bottom:active {
  background-color: var(--nav-active-bg);
  transform: scale(0.95);
}

/* BOUTON FLOTTANT */
.wpt-nav-right-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--floating-btn-size);
  height: 100%;
  margin-bottom: calc(var(--bottom-nav-height) - (var(--floating-btn-size) / 2));
}
.wpt-nav-btn-floating {
  width: var(--floating-btn-size);
  height: var(--floating-btn-size);
  background: #fff;
  border: none;
  border-radius: 50%;
  box-shadow: var(--floating-btn-elevation);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s;
}
.wpt-nav-btn-floating img {
  width: var(--floating-icon-size);
  height: var(--floating-icon-size);
}
.wpt-nav-btn-floating:hover {
  transform: translateY(-4px) scale(1.05);
}
.wpt-nav-btn-floating:active {
  transform: scale(0.95);
}

/* =============================
   9) BOTTOM SHEET & OVERLAY
============================= */
.wpt-bottom-sheet-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0; 
  visibility: hidden;
  transition: opacity 0.3s ease;
  z-index: 1000;
}
.wpt-bottom-sheet-overlay.active {
  opacity: 1;
  visibility: visible;
}

.wpt-bottom-sheet {
  position: fixed;
  left: 0; right: 0;
  bottom: -100%;
  background: #fff;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.3);
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  z-index: 1001;
  transition: bottom 0.4s var(--ease-out-elastic);
  max-height: 80vh;
}
.wpt-bottom-sheet.active {
  bottom: 0;
}
.wpt-bottom-sheet-content {
  padding: 1rem;
  background-color: var(--bg-main);
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 150px;
}
.wpt-bottom-sheet-drag-handle {
  width: 40px;
  height: 4px;
  background: #ccc;
  border-radius: 2px;
  margin: 0.5rem auto;
  visibility: none;
}
.wpt-bottom-sheet-close-btn {
  z-index: 1000;
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  font-size: 2.5rem;
  background-color: white;
  padding: 3px 12px 8px 12px;
  border-radius: 30%;
  line-height: 1;
  cursor: pointer;
  color: #888;
  transition: transform 0.2s, color 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin: 25px 15px 0 0;
}
.wpt-bottom-sheet-close-btn:hover {
  color: var(--color-primary);
  transform: scale(1.2);
}
.wpt-bottom-sheet-close-btn:active {
  transform: scale(0.9);
}

/* =============================
   10) ANIMATIONS D’APPARITION / DISPARITION
============================= */
.hidden {
  pointer-events: none;
}

.reappearTop {
  transform: translateY(0);
  transition: transform 0.4s var(--ease-out-elastic);
}

.reappearBottom {
  transform: translateY(0);
  transition: transform 0.4s var(--ease-out-elastic);
}

/* On précise pour chaque bloc fixe les effets de hide */
#wpt_header.hidden {
  transform: translateY(-100px);
}
#wpt_actions_bar.hidden {
  transform: translateY(-50px);
}
#wpt_bottom_nav.hidden {
  transform: translateY(80px);
}

/* =============================
   11) FOCUS ACCESSIBLE
============================= */
:focus {
  outline: none;
}
:focus-visible {
  outline: 2px dashed var(--color-primary);
  outline-offset: 2px;
}

/* === Bouton flottant (similaire à la version desktop) === */
.wpt-toggle-right-sidebar-btn {
  position: fixed;
  bottom: 80px; 
  right: 20px;
  z-index: 999;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #DDE1E7;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wpt-toggle-right-sidebar-btn i {
  font-size: 1.2rem;
  color: #333;
}

/* === Sidebar droite sur mobile === */
.mobile-right-sidebar {
  position: fixed;
  top: 0; bottom: 0; right: 0;
  width: 280px;
  background: #fff;
  box-shadow: -2px 0 6px rgba(0,0,0,0.2);
  z-index: 9999;
  transition: transform 0.3s ease;
}
.mobile-right-sidebar-collapsed {
  transform: translateX(100%);
}
.mobile-right-sidebar__inner {
  padding: 15px;
  height: 100%;
  overflow-y: auto;
}
#conseils-icon {
  top: calc(var(--wpt-header-height) + var(--wpt-subheader-height) + 0.75rem);
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1rem;
  right: 0.75rem;
  margin-top: 18px;
}