/* 
 * SYSTÈME UNIFORME - PROFIL ET CRÉDITS
 * Positions et tailles EXACTES identiques sur TOUTES les pages
 * Ces styles ont la priorité absolue (!important)
 */

/* ============ CONTENEUR GLOBAL POUR PROFIL ET CRÉDITS ============ */
.header-right-container {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  z-index: 9999 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

/* ============ ICÔNE DE PROFIL - POSITION ET TAILLE UNIFORMES ============ */
.profile-button,
#profile-button {
  /* Dimensions */
  width: 56px !important;
  height: 56px !important;
  
  /* Style de base */
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer !important;
  position: relative !important; /* Changé de absolute/fixed à relative */
  order: 2; /* Le profil est à droite */
}

.profile-button img,
#profile-button img {
  /* Dimensions de l'image */
  width: 100% !important;
  height: 100% !important;
  
  /* Style uniforme */
  border-radius: 50% !important;
  border: 2px solid #00b8ff !important;
  object-fit: cover !important;
  
  /* Transition uniforme */
  transition: all 0.3s ease !important;
  
  /* Ombre uniforme */
  box-shadow: 0 2px 8px rgba(0, 184, 255, 0.3) !important;
}

.profile-button img:hover,
#profile-button img:hover {
  transform: scale(1.05) !important;
  box-shadow: 0 4px 12px rgba(0, 184, 255, 0.5) !important;
  border-color: #00ff95 !important;
}

/* ============ INDICATEUR DE CRÉDITS - POSITION ET TAILLE UNIFORMES ============ */
#credits-indicator,
.credits-indicator {
  /* Dimensions - même hauteur que le profil */
  height: 56px !important;
  min-width: 80px !important;
  padding: 0 16px !important; /* Padding horizontal uniquement */
  margin: 0 !important;
  
  /* Style uniforme */
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  border: 2px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 28px !important; /* Moitié de la hauteur */
  
  /* Centrage du contenu */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important; /* Espacement entre l'icône et le texte */
  
  /* Texte uniforme */
  color: white !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
  text-decoration: none !important;
  
  /* Transition et Ombre */
  transition: transform 0.3s ease, box-shadow 0.3s ease !important;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3) !important;
  
  /* Curseur */
  cursor: pointer !important;
  position: relative !important; /* Changé de absolute/fixed à relative */
  order: 1; /* Les crédits sont à gauche */
}

#credits-indicator:hover,
.credits-indicator:hover {
  transform: scale(1.05) !important;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5) !important;
}

#credits-indicator span,
.credits-indicator span {
  color: white !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
  line-height: 1 !important;
}

/* Force white text for credits - additional specificity */
#credits-indicator #user-credits,
.credits-indicator #user-credits,
#credits-indicator .credits-text,
.credits-indicator .credits-text {
  color: white !important;
}

/* Style pour l'icône des crédits */
#credits-indicator i,
.credits-indicator i {
  color: white !important;
  font-size: 16px !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

/* ============ TOOLTIP (INFOBULLE) - STYLE UNIFIÉ ============ */
.custom-tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute !important;
  top: calc(100% + 10px) !important; /* Positionné en-dessous de l'élément parent */
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 10001 !important;
  
  /* Style du tooltip */
  background: linear-gradient(135deg, rgba(40, 42, 54, 0.95) 0%, rgba(30, 32, 42, 0.95) 100%) !important;
  color: #f8f8f2 !important;
  text-align: center !important;
  padding: 8px 12px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  
  /* Effets visuels */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  
  /* Transition */
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease !important;
  transform-origin: top center !important;
}

/* Flèche du tooltip - maintenant pointant vers le haut */
.custom-tooltip::before {
  content: '' !important;
  position: absolute !important;
  bottom: 100% !important;
  left: 50% !important;
  margin-left: -5px !important;
  border-width: 5px !important;
  border-style: solid !important;
  border-color: transparent transparent rgba(40, 42, 54, 0.95) transparent !important;
}

/* Affichage du tooltip au survol */
.profile-button:hover .custom-tooltip,
#credits-indicator:hover .custom-tooltip {
  visibility: visible !important;
  opacity: 1 !important;
  transform: translateX(-50%) translateY(5px) !important; /* Léger décalage vers le bas */
}


/* ============ RESPONSIVE - ADAPTATION MOBILE ============ */
@media (max-width: 768px) {
  .header-right-container {
    top: 15px !important;
    right: 15px !important;
    gap: 8px !important;
  }
  
  .profile-button,
  #profile-button {
    width: 48px !important;
    height: 48px !important;
  }
  
  #credits-indicator,
  .credits-indicator {
    height: 48px !important;
    min-width: 70px !important;
    padding: 0 12px !important;
    border-radius: 24px !important;
    font-size: 12px !important;
  }
  
  #credits-indicator span,
  .credits-indicator span {
    font-size: 12px !important;
  }
}

@media (max-width: 480px) {
  .header-right-container {
    top: 10px !important;
    right: 10px !important;
    gap: 6px !important;
  }
  
  .profile-button,
  #profile-button {
    width: 42px !important;
    height: 42px !important;
  }
  
  #credits-indicator,
  .credits-indicator {
    height: 42px !important;
    min-width: auto !important; /* Permet de réduire la largeur */
    padding: 0 10px !important;
    border-radius: 21px !important;
    font-size: 11px !important;
  }
  
  #credits-indicator span,
  .credits-indicator span {
    font-size: 11px !important;
  }

  /* Cacher le texte des crédits sur très petits écrans si nécessaire */
  /*
  #credits-indicator span {
     display: none;
  }
  */
}

/* ============ ANNULATION DES STYLES CONFLICTUELS (si nécessaire) ============ */
/* Cette section peut être utilisée pour surcharger des styles spécifiques d'autres fichiers */
body .profile-button,
body #profile-button,
body #credits-indicator,
body .credits-indicator {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    margin: 0 !important;
}
