/* Corrections de la Navbar du Super Admin Dashboard */
/* AutoBF - 2025-01-XX */

/* Correction générale pour tous les boutons de navigation */
nav button,
header button,
[class*="navbar"] button,
[class*="nav"] button,
[class*="header"] button,
nav a button,
header a button {
  /* Détection automatique du fond pour appliquer la bonne couleur */
  color: #ffffff !important; /* Texte blanc par défaut (fond sombre) */
  font-weight: 500 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease-in-out;
}

/* Si le bouton est sur un fond clair, utiliser texte foncé */
nav.bg-white button,
nav.bg-gray-50 button,
nav.bg-gray-100 button,
header.bg-white button,
header.bg-gray-50 button,
header.bg-gray-100 button,
[class*="navbar"][class*="bg-white"] button,
[class*="navbar"][class*="bg-gray-50"] button,
[class*="navbar"][class*="bg-gray-100"] button,
[class*="header"][class*="bg-white"] button,
[class*="header"][class*="bg-gray-50"] button,
[class*="header"][class*="bg-gray-100"] button {
  color: #111827 !important; /* Texte gris foncé sur fond clair */
  font-weight: 600 !important;
  text-shadow: none !important;
}

/* Correction pour les boutons de navigation avec fond sombre */
nav.bg-gray-900 button,
nav.bg-gray-800 button,
nav.bg-black button,
header.bg-gray-900 button,
header.bg-gray-800 button,
header.bg-black button,
[class*="navbar"][class*="bg-gray-900"] button,
[class*="navbar"][class*="bg-gray-800"] button,
[class*="navbar"][class*="bg-black"] button,
[class*="header"][class*="bg-gray-900"] button,
[class*="header"][class*="bg-gray-800"] button,
[class*="header"][class*="bg-black"] button {
  color: #ffffff !important;
  font-weight: 600 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Liens dans la navbar */
nav a,
header a,
[class*="navbar"] a,
[class*="nav"] a,
[class*="header"] a {
  color: #ffffff !important;
  font-weight: 500 !important;
  text-decoration: none;
}

/* Liens dans navbar avec fond clair */
nav.bg-white a,
nav.bg-gray-50 a,
header.bg-white a,
header.bg-gray-50 a,
[class*="navbar"][class*="bg-white"] a,
[class*="navbar"][class*="bg-gray-50"] a,
[class*="header"][class*="bg-white"] a,
[class*="header"][class*="bg-gray-50"] a {
  color: #111827 !important;
  font-weight: 600 !important;
}

/* Correction spécifique pour les boutons avec texte noir (problème signalé) */
nav button.text-black,
header button.text-black,
nav button[class*="text-black"],
header button[class*="text-black"],
nav button[style*="color: black"],
header button[style*="color: black"],
nav button[style*="color:#000"],
header button[style*="color:#000"],
nav a.text-black,
header a.text-black,
nav a[class*="text-black"],
header a[class*="text-black"] {
  color: #ffffff !important; /* Forcer blanc sur fond sombre */
  font-weight: 600 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Correction spécifique pour le texte "Dashboard" - Utilisation de sélecteurs CSS valides */
button[aria-label*="Dashboard"],
a[href*="dashboard"],
a[href*="super-admin"],
a[href*="admin-dashboard"],
nav a[href*="dashboard"],
header a[href*="dashboard"],
nav button[aria-label*="Dashboard"],
header button[aria-label*="Dashboard"] {
  color: #ffffff !important;
  font-weight: 600 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Correction pour les icônes de notifications et autres icônes dans la navbar */
nav svg,
header svg,
nav [class*="icon"],
header [class*="icon"],
nav [class*="Icon"],
header [class*="Icon"],
nav button svg,
header button svg,
nav a svg,
header a svg,
nav [class*="notification"],
header [class*="notification"],
nav [class*="Notification"],
header [class*="Notification"],
nav [aria-label*="notification"],
header [aria-label*="notification"],
nav [aria-label*="Notification"],
header [aria-label*="Notification"] {
  color: #ffffff !important;
  fill: #ffffff !important;
  stroke: #ffffff !important;
}

/* Correction spécifique pour les icônes avec couleur noire */
nav svg[style*="color: black"],
header svg[style*="color: black"],
nav svg[style*="color:#000"],
header svg[style*="color:#000"],
nav svg[style*="fill: black"],
header svg[style*="fill: black"],
nav svg[style*="fill:#000"],
header svg[style*="fill:#000"],
nav svg[style*="stroke: black"],
header svg[style*="stroke: black"],
nav svg[style*="stroke:#000"],
header svg[style*="stroke:#000"] {
  color: #ffffff !important;
  fill: #ffffff !important;
  stroke: #ffffff !important;
}

/* Si le bouton avec texte noir est sur fond clair */
nav.bg-white button.text-black,
nav.bg-gray-50 button.text-black,
header.bg-white button.text-black,
header.bg-gray-50 button.text-black {
  color: #111827 !important; /* Texte foncé sur fond clair */
  font-weight: 600 !important;
  text-shadow: none !important;
}

/* Correction pour les spans et textes dans les boutons de navigation */
nav button span,
header button span,
nav a span,
header a span {
  color: #ffffff !important; /* Forcer blanc pour les spans dans la navbar */
}

/* Correction pour les éléments enfants dans les boutons de navigation */
nav button *:not(svg),
header button *:not(svg),
nav a *:not(svg),
header a *:not(svg) {
  color: #ffffff !important; /* Forcer blanc pour tous les éléments texte */
}

/* Exception pour les icônes SVG - déjà géré ci-dessus */

/* Classe ajoutée par JavaScript pour forcer le texte en blanc */
.navbar-white-text {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
  font-weight: 600 !important;
}

/* Forcer tous les textes dans nav/header en blanc par défaut */
nav,
header,
[class*="navbar"],
[class*="header"] {
  color: #ffffff !important;
}

nav *,
header *,
[class*="navbar"] *,
[class*="header"] * {
  color: #ffffff !important;
}

/* Exception pour les SVG - géré séparément */
nav svg,
header svg,
[class*="navbar"] svg,
[class*="header"] svg {
  color: #ffffff !important;
  fill: #ffffff !important;
  stroke: #ffffff !important;
}

/* Hover sur boutons de navigation */
nav button:hover,
header button:hover,
[class*="navbar"] button:hover,
[class*="header"] button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Focus pour l'accessibilité */
nav button:focus-visible,
header button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* Correction spécifique pour la page Super Admin Dashboard */
body[class*="super-admin"] nav button,
body[class*="super-admin"] header button,
[data-page="super-admin"] nav button,
[data-page="super-admin"] header button {
  color: #ffffff !important;
  font-weight: 600 !important;
}

/* Correction pour les éléments de navigation dans des conteneurs spécifiques */
[class*="SuperAdmin"] nav button,
[class*="SuperAdmin"] header button,
[class*="Dashboard"] nav button,
[class*="Dashboard"] header button {
  color: #ffffff !important;
  font-weight: 600 !important;
}

