/* ============================================
   CORRECTIONS DES BOUTONS - AutoBF
   Date: 2025-01-XX
   Objectif: Corriger la visibilité des textes de boutons
   ============================================ */

/* 1. Boutons avec texte noir - Améliorer le contraste */
button.text-black,
button.text-gray-900,
.btn.text-black,
.btn.text-gray-900 {
  color: #1f2937 !important; /* gray-800 - meilleur contraste */
  font-weight: 500 !important;
}

/* 2. Boutons sur fond clair - Assurer un bon contraste */
button.bg-white,
button.bg-gray-50,
button.bg-gray-100,
button.bg-gray-200 {
  color: #111827 !important; /* gray-900 - excellent contraste */
  font-weight: 500 !important;
}

/* 3. Boutons outline - Améliorer la visibilité */
button[class*="border"]:not([class*="text-white"]):not([class*="text-bf"]):not([class*="text-green"]):not([class*="text-blue"]):not([class*="text-red"]):not([class*="text-orange"]) {
  color: #374151 !important; /* gray-700 */
  font-weight: 500 !important;
}

/* 4. Boutons sur fond coloré - Forcer texte blanc si nécessaire */
button.bg-bf-red,
button.bg-bf-orange,
button.bg-bf-green,
button.bg-yellow-600,
button.bg-green-600,
button.bg-blue-600,
button.bg-red-600,
button[class*="bg-bf-red"],
button[class*="bg-bf-orange"],
button[class*="bg-bf-green"],
button[class*="bg-yellow"],
button[class*="bg-green"],
button[class*="bg-blue"],
button[class*="bg-red"] {
  color: #ffffff !important;
  font-weight: 600 !important;
}

/* 5. Boutons avec fond semi-transparent - Améliorer le contraste */
button[class*="bg-white/"],
button[class*="bg-gray/"] {
  color: #111827 !important;
  font-weight: 500 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 6. Boutons hover - Maintenir la visibilité */
button:hover:not([disabled]) {
  opacity: 0.9;
}

button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 7. Boutons dans les formulaires - Standardiser */
form button[type="submit"],
form button[type="button"] {
  font-weight: 500 !important;
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
}

/* 8. Boutons avec icônes - Espacement */
button svg + span,
button span + svg {
  margin-left: 0.5rem;
  margin-right: 0.5rem;
}

/* 9. Boutons de navigation - Visibilité améliorée */
nav button,
header button {
  font-weight: 500 !important;
}

/* 10. Boutons CTA (Call to Action) - Contraste maximal */
button[class*="cta"],
.cta-button,
button.bg-bf-orange,
button.bg-bf-red,
button.bg-bf-green {
  color: #ffffff !important;
  font-weight: 600 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 11. Boutons secondaires - Contraste suffisant */
button[class*="outline"],
button[class*="secondary"] {
  font-weight: 500 !important;
  border-width: 2px !important;
}

/* 12. Correction spécifique pour les boutons avec texte gris foncé */
button.text-gray-700,
button.text-gray-800 {
  color: #374151 !important; /* gray-700 */
  font-weight: 500 !important;
}

/* 13. Assurer que tous les boutons ont un contraste minimum */
button:not([class*="text-white"]):not([class*="text-bf"]):not([class*="text-green"]):not([class*="text-blue"]):not([class*="text-red"]):not([class*="text-orange"]) {
  color: #1f2937 !important; /* gray-800 par défaut */
}

/* 14. Exception pour les boutons avec classes de couleur explicites */
button.text-white,
button.text-bf-orange,
button.text-bf-red,
button.text-bf-green,
button.text-green-600,
button.text-blue-600,
button.text-red-600 {
  /* Conserver les couleurs spécifiques */
}

/* 15. Amélioration de la lisibilité générale */
button {
  letter-spacing: 0.025em;
  transition: all 0.2s ease-in-out;
}

/* 16. Boutons sur fond sombre - Forcer texte clair */
.bg-gray-900 button,
.bg-gray-800 button,
.bg-black button,
[class*="bg-gray-900"] button,
[class*="bg-gray-800"] button {
  color: #ffffff !important;
}

/* 17. Correction pour les boutons dans les cards */
.card button,
[class*="card"] button {
  font-weight: 500 !important;
}

/* 18. Media queries pour mobile - Augmenter la taille du texte si nécessaire */
@media (max-width: 640px) {
  button {
    font-size: 0.875rem !important; /* 14px minimum */
    padding: 0.625rem 1rem !important;
  }
}

/* 19. Focus states pour l'accessibilité */
button:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* 20. Correction finale - S'assurer qu'aucun bouton n'a de texte invisible */
button:not([disabled]):not([class*="text-white"]):not([class*="text-bf"]):not([class*="text-green"]):not([class*="text-blue"]):not([class*="text-red"]):not([class*="text-orange"]) {
  color: #1f2937 !important;
  font-weight: 500 !important;
}


