/* ================================================
   HEADER AUTHENTIFIÉ - Desktop
   Intégré depuis navigation.css (lignes 1-345)
   ================================================ */

/* Transitions harmonisées - TOUTES 0.3s ease */
.logo,
.nav-item,
.btn-premium,
.premium-badge-header,
.language-globe-btn,
.user-profile-trigger {
  transition: all 0.3s ease !important;
}

/* === MODERN HEADER === */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--gray-300);
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Header non-scrolled - Hauteur explicite */
header.header:not(.scrolled) {
  height: 70px;
}

header.header:not(.scrolled) .header-content {
  height: 70px;
}

/* Header scrolled - ÉTAPE 1 */
header.header.scrolled {
  background: rgba(230, 57, 92, 0.86); /* Rose foncé comme landing */
  backdrop-filter: blur(35px) saturate(180%);
  -webkit-backdrop-filter: blur(35px) saturate(180%);
  border-bottom: 1px solid rgba(255, 56, 92, 0.12);
  box-shadow: 0 4px 16px rgba(255, 56, 92, 0.08);
}

/* Header scrolled - Hauteur réduite */
header.header.scrolled {
  height: 60px !important; /* Au lieu de 70px */
  transition: height 0.3s ease, background 0.3s ease, box-shadow 0.3s ease !important;
}

header.header.scrolled .header-content {
  height: 60px !important;
  transition: height 0.3s ease !important;
}

/* Logo réduit en scrolled */
header.header.scrolled .logo svg {
  width: 36px !important;
  height: 36px !important;
  transition: width 0.3s ease, height 0.3s ease !important;
}

.header-content {
  max-width: 100%;
  margin: 0;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 70px;
  gap: 32px;
}

/* Logo */
.logo {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 24px;
  font-weight: 700;
  flex-shrink: 0;
  transition: opacity 0.2s;
  line-height: 1.2;
}

/* .logo span - color: inherit supprimé pour permettre Phase 1 haute spécificité */

.logo:hover {
  opacity: 0.8;
}

.logo svg {
  height: 40px;
  width: 40px;
  flex-shrink: 0;
  color: var(--primary, #FF385C);
}

.logo img {
  height: 40px;
  width: auto;
}

/* Logo couleur adaptative - ÉTAPE 2 */
header.header .logo {
  color: var(--primary, #FF385C); /* Rose sur fond blanc */
}

header.header.scrolled .logo {
  color: #FFFFFF; /* Blanc sur fond rose */
}

header.header.scrolled .logo svg {
  color: #FFFFFF; /* SVG blanc sur fond rose */
}

/* Main Navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.nav-item {
  /* Padding uniforme */
  padding: 10px 16px !important;
  border-radius: 8px !important;
  
  /* Transition smooth */
  transition: all 0.3s ease !important;
  
  /* Hauteur fixe pour alignement */
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-700);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 56, 92, 0.08) !important; /* Fond rose subtil */
  transform: translateY(-1px) !important;
  color: var(--gray-900);
}

.nav-item.active {
  background: rgba(255, 56, 92, 0.12) !important; /* Fond rose actif */
  font-weight: 600 !important;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(255, 56, 92, 0.1), rgba(227, 28, 95, 0.05));
  color: var(--primary);
  font-weight: 600;
}

.nav-item i {
  font-size: 18px;
}

/* Notification button */
.notification-btn {
  position: relative !important;
  border: none;
  background: none;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  z-index: 10;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: #E61E4D;
  color: white;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.badge-notif {
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 10px;
  min-width: 16px;
  height: 16px;
  text-align: center;
  margin-left: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 20px !important;  /* Gap confortable desktop */
}

/* Badge Premium - Format PILL desktop, ROND mobile */
.btn-premium,
.premium-badge-header {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  
  /* Format PILL desktop (ovale horizontal) */
  padding: 8px 14px !important;
  gap: 6px !important;
  border-radius: 20px !important;
  width: auto !important;
  height: auto !important;
  min-height: 44px !important;
  
  /* Effet glassmorphism */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  
  /* Transition smooth */
  transition: all 0.3s ease !important;
}

.btn-premium {
  background: linear-gradient(135deg, #FFB800, #FF8C00);
  color: white;
  border: none;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(255, 184, 0, 0.3);
}

.btn-premium i,
.premium-badge-header i {
  margin: 0 !important;
}

.btn-premium:hover,
.premium-badge-header:hover {
  transform: translateY(-2px) !important;
}

/* Badge Premium scrolled - GARDE format pill, change couleurs seulement */
header.header.scrolled .btn-premium,
header.header.scrolled .premium-badge-header {
  /* Pas de width/height = garde format pill auto */
  background: rgba(255, 255, 255, 0.15) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
  color: white !important;
}

/* Badge Premium - Format ROND en mobile */
@media (max-width: 900px) {
  .btn-premium,
  .premium-badge-header {
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    gap: 0 !important;
    min-width: 38px !important;
    min-height: 38px !important;
  }
  
  /* Cacher texte "Premium" en mobile */
  .btn-premium span,
  .premium-badge-header span {
    display: none !important;
  }
}

.premium-badge-header {
  /* Styles pill hérités des lignes 215-233 */
  background: linear-gradient(135deg, rgba(255, 184, 0, 0.15), rgba(255, 140, 0, 0.1));
  color: #FF8C00;
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid rgba(255, 184, 0, 0.3);
}

.premium-badge-header i {
  font-size: 14px;
}

/* User Menu */
.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 4px 10px !important;
  width: auto !important;
  height: auto !important;
  min-height: 44px !important;
  border-radius: 22px !important;
  background: var(--gray-100);
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.user-menu-trigger:hover {
  background: var(--gray-200) !important;
}

/* État scroll=0 - Fond rose très léger pour cohérence avec nom rose */
.header:not(.scrolled) .user-menu-trigger {
  background: rgba(255, 56, 92, 0.08);
}

/* Hover en scroll=0 */
.header:not(.scrolled) .user-menu-trigger:hover {
  background: rgba(255, 56, 92, 0.15);
}

/* État scrolled - Fond sombre pour contraste avec texte blanc */
.header.scrolled .user-menu-trigger {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Hover en état scrolled - Fond plus opaque pour contraste */
.header.scrolled .user-menu-trigger:hover {
  background: rgba(0, 0, 0, 0.35) !important;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Globe - Adaptatif selon état header */
/* ═══════════════════════════════════════════════════════════
   UNIFORMISATION COULEURS HEADER
   ═══════════════════════════════════════════════════════════ */

/* SCROLL = 0 (fond blanc) : Tous éléments ROSE */
.header:not(.scrolled) .btn-premium,
.header:not(.scrolled) .premium-badge-header {
  color: var(--primary);
}

.header:not(.scrolled) .btn-premium i,
.header:not(.scrolled) .premium-badge-header i {
  color: var(--primary);  /* Couronne rose */
}

.header:not(.scrolled) .language-globe-btn {
  background: rgba(255, 56, 92, 0.1);  /* Fond rose clair */
  border: 1.5px solid rgba(255, 56, 92, 0.2);  /* Bordure rose */
  color: var(--primary);  /* Icône rose */
}

/* SCROLL > 50px (fond rose) : Tous éléments BLANC */
.header.scrolled .btn-premium,
.header.scrolled .premium-badge-header {
  color: white;
}

.header.scrolled .btn-premium i,
.header.scrolled .premium-badge-header i {
  color: white;  /* Couronne blanche */
}

.header.scrolled .language-globe-btn {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;  /* Icône blanche */
}

/* ═══════════════════════════════════════════════════════════
   RÈGLES HAUTE SPÉCIFICITÉ LOGO - Sécurité contre bloquants
   ═══════════════════════════════════════════════════════════ */

/* Logo texte - Header blanc (scroll = 0) */
#header.header:not(.scrolled) .logo span:not(.logo-subtitle),
#header.header:not(.scrolled) .logo span:first-child:not(.logo-subtitle) {
  color: var(--primary) !important;
}

/* Logo SVG - Header blanc */
#header.header:not(.scrolled) .logo svg {
  color: var(--primary) !important;
}

/* Logo texte - Header rose scrolled */
#header.header.scrolled .logo span:not(.logo-subtitle),
#header.header.scrolled .logo span:first-child:not(.logo-subtitle) {
  color: white !important;
  opacity: 1 !important;  /* Blanc pur, pas de dilution */
}

/* Logo SVG - Header rose scrolled */
#header.header.scrolled .logo svg {
  color: white !important;
}

/* Sous-titre logo - Header blanc */
#header.header:not(.scrolled) .logo-subtitle {
  color: var(--gray-600) !important;  /* Gris sur fond blanc - !important pour écraser .logo span */
  font-size: 10px;
  margin-top: 2px;
}

/* Sous-titre logo - Header rose scrolled */
#header.header.scrolled .logo-subtitle {
  color: rgba(255, 255, 255, 0.9) !important;  /* Blanc transparent sur rose */
  font-size: 10px;
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════
   GLOBE / LANGUAGE SELECTOR - Règles haute spécificité
   ═══════════════════════════════════════════════════════════ */

/* Globe - Scroll = 0 (Rose sur fond blanc) */
#header.header:not(.scrolled) .language-globe-btn,
#header.header:not(.scrolled) button.language-globe-btn {
  background: rgba(255, 56, 92, 0.15) !important;  /* Rose clair visible */
  border: 1.5px solid rgba(255, 56, 92, 0.3) !important;  /* Bordure rose */
  color: var(--primary) !important;  /* Icône rose */
  opacity: 1 !important;  /* Pas de dilution */
}

/* Globe SVG/Icon - Scroll = 0 */
#header.header:not(.scrolled) .language-globe-btn i,
#header.header:not(.scrolled) .language-globe-btn svg {
  color: var(--primary) !important;
  opacity: 1 !important;
}

/* Globe - Scrolled (Blanc sur fond rose) */
#header.header.scrolled .language-globe-btn,
#header.header.scrolled button.language-globe-btn {
  background: rgba(255, 255, 255, 0.15) !important;  /* Blanc transparent */
  border: 1.5px solid rgba(255, 255, 255, 0.4) !important;  /* Bordure blanche */
  color: white !important;  /* Icône blanche */
  opacity: 1 !important;
}

/* Globe SVG/Icon - Scrolled */
#header.header.scrolled .language-globe-btn i,
#header.header.scrolled .language-globe-btn svg {
  color: white !important;
  opacity: 1 !important;
}

/* ═══════════════════════════════════════════════════════════
   GLOBE AUTH PAGES - Style Phase 3 moderne (isolé de landing)
   ═══════════════════════════════════════════════════════════ */

/* Globe auth pages - Style Phase 3 moderne */
#header.header .language-globe-btn {
  width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  font-size: 18px !important;
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Globe auth scrolled - Réduit */
#header.header.scrolled .language-globe-btn {
  width: 40px !important;
  height: 40px !important;
}

/* Globe auth hover */
#header.header .language-globe-btn:hover {
  transform: scale(1.08) translateY(-2px) !important;
}

/* ═══════════════════════════════════════════════════════════
   COURONNE PREMIUM - Règles haute spécificité
   ═══════════════════════════════════════════════════════════ */

/* Couronne - Scroll = 0 (Rose) */
#header.header:not(.scrolled) .btn-premium,
#header.header:not(.scrolled) .premium-badge-header {
  background: rgba(255, 56, 92, 0.1) !important;  /* Fond rose très léger */
  border: 1.5px solid var(--primary) !important;  /* Bordure rose */
  color: var(--primary) !important;  /* Icône/texte rose */
  box-shadow: 0 2px 8px rgba(255, 56, 92, 0.15) !important; /* Ombre rose */
}

/* Couronne Icon - Scroll = 0 */
#header.header:not(.scrolled) .btn-premium i,
#header.header:not(.scrolled) .btn-premium svg,
#header.header:not(.scrolled) .premium-badge-header i {
  color: var(--primary) !important;
}

/* Couronne - Scrolled (Blanc) - AUSSI pour badge pill Premium */
#header.header.scrolled .btn-premium,
#header.header.scrolled .premium-badge-header {
  /* Pas de width/height ici = garde format pill */
  background: rgba(255, 255, 255, 0.15) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
  color: white !important;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2) !important;
}

/* Icons/texte blanc aussi */
#header.header.scrolled .btn-premium i,
#header.header.scrolled .btn-premium svg,
#header.header.scrolled .btn-premium span,
#header.header.scrolled .premium-badge-header i,
#header.header.scrolled .premium-badge-header span {
  color: white !important;
}

/* ═══════════════════════════════════════════════════════════
   NAVIGATION ICONS - Règles haute spécificité
   ═══════════════════════════════════════════════════════════ */

/* Navigation - Scroll = 0 (Rose) */
#header.header:not(.scrolled) .main-nav .nav-item,
#header.header:not(.scrolled) .main-nav .nav-item a,
#header.header:not(.scrolled) .main-nav .nav-item i {
  color: var(--primary) !important;  /* Rose */
}

/* Navigation - Scrolled (Blanc) */
#header.header.scrolled .main-nav .nav-item,
#header.header.scrolled .main-nav .nav-item a,
#header.header.scrolled .main-nav .nav-item i {
  color: white !important;  /* Blanc */
}

/* Navigation hover - Scroll = 0 */
#header.header:not(.scrolled) .main-nav .nav-item:hover,
#header.header:not(.scrolled) .main-nav .nav-item:hover i {
  color: var(--primary) !important;  /* Rose foncé au hover */
  opacity: 0.8 !important;
}

/* Navigation hover - Scrolled */
#header.header.scrolled .main-nav .nav-item:hover,
#header.header.scrolled .main-nav .nav-item:hover i {
  color: white !important;
  opacity: 0.8 !important;
}

/* Avatar container - Centrage parfait */
.user-avatar {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #E31C5F);
  color: white;
  font-weight: 600;
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-avatar i {
  font-size: 18px;
}

/* User info - Visible en desktop, caché en mobile */
.user-info {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  margin-left: 8px;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--gray-500);
  white-space: nowrap;
}

/* Nom + sous-titre - ROSE scroll=0 */
#header.header:not(.scrolled) .user-name,
#header.header:not(.scrolled) .user-role {
  color: var(--primary) !important;
}

/* Nom + sous-titre - BLANC scrolled */
#header.header.scrolled .user-name,
#header.header.scrolled .user-role {
  color: white !important;
}

.user-menu-trigger .fa-chevron-down {
  display: block !important;
  font-size: 12px;
  color: var(--gray-500);
  transition: transform 0.2s ease;
}

/* Chevron visible en scrolled */
#header.header.scrolled .user-menu-trigger .fa-chevron-down {
  color: white;
}

.user-menu-trigger:hover .fa-chevron-down {
  transform: translateY(2px);
}

/* Dropdown */
.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1001;
  padding: 8px 0;
}

.dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  color: var(--gray-700);
  font-size: 14px;
}

.dropdown-item:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.dropdown-item i {
  width: 20px;
  text-align: center;
  color: var(--gray-600);
  font-size: 16px;
}

.dropdown-item:hover i {
  color: var(--primary);
}

.dropdown-item.premium-item {
  background: linear-gradient(135deg, rgba(255, 184, 0, 0.08), rgba(255, 140, 0, 0.05));
  color: #FF8C00;
  font-weight: 600;
  position: relative;
}

.dropdown-item.premium-item i {
  color: #FF8C00;
}

.dropdown-item.premium-item:hover {
  background: linear-gradient(135deg, rgba(255, 184, 0, 0.15), rgba(255, 140, 0, 0.1));
}

.badge-new {
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  margin-left: auto;
}

.dropdown-divider {
  height: 1px;
  background: var(--gray-300);
  margin: 8px 0;
}

/* === ESPACEMENT PAGES AUTHENTIFIÉES === */
/* Ajouter un espace suffisant entre le header fixe et le contenu */
#app #main {
  padding-top: 70px; /* Hauteur header exacte, pas 90px */
  margin-top: 0 !important; /* Forcer margin 0 */
}

/* Supprimer margin premier enfant */
#app #main > *:first-child {
  margin-top: 0 !important; /* Supprimer margin premier élément */
}

#app #view-container {
  padding-top: 0;
}

/* Responsive Tablet */
@media (max-width: 1024px) {
  .nav-item span {
    display: none;
  }
  
  .nav-item {
    padding: 10px 12px;
  }
}

/* Tablette (768-900px) */
@media (max-width: 900px) {
  .header-actions {
    gap: 16px !important; /* Gap réduit mais respire (au lieu de 12px) */
  }
  
  .header-content {
    gap: 16px !important; /* Réduire gap total */
  }
  
  .btn-premium,
  .premium-badge-header,
  .language-globe-btn {
    flex-shrink: 0 !important;
    min-width: 40px !important;
    min-height: 40px !important;
  }
}

@media (max-width: 768px) {
  #app #main {
    padding-top: 70px; /* Cohérent avec desktop */
  }
  
  /* Mobile (< 768px) */
  .header-actions {
    gap: 12px !important; /* Gap minimal mais visible (au lieu de 10px) */
  }
  
  .header-content {
    gap: 12px !important; /* Gap minimal */
    padding: 0 16px !important; /* Padding réduit */
  }
  
  /* Tailles réduites */
  .btn-premium,
  .premium-badge-header,
  .language-globe-btn,
  .user-profile-trigger {
    width: 38px !important;
    height: 38px !important;
  }
  
  .logo svg {
    width: 36px !important;
    height: 36px !important;
  }
}

/* Mobile très petit (< 480px) */
@media (max-width: 480px) {
  .header-content {
    padding: 0 12px !important; /* Padding minimal */
    gap: 8px !important; /* Gap très réduit */
  }
  
  .header-actions {
    gap: 10px !important; /* Gap très réduit mais visible (au lieu de 8px) */
  }
}

