/* ════════════════════════════════════════════════════════════════════
 * dark-on-dark-ban.css — UI Sealing 07 mai 2026
 * ════════════════════════════════════════════════════════════════════
 * Mission : bannir DEFINITIVEMENT les boutons "sombre sur sombre"
 * (texte foncé sur fond foncé, ou inversement texte invisible).
 *
 * Strategie :
 *   1. Tous les boutons avec backgrounds DARK (slate/black/violet/indigo)
 *      ont un texte BLANC pur force a 100% opacite.
 *   2. Tous les boutons avec backgrounds CLAIRS (white/gray-50)
 *      ont un texte SOMBRE (#0f172a) force.
 *   3. Boutons "primary" (CTA principal) = violet/blue vibrant + white text.
 *
 * Charge en TOUT DERNIER (apres theme-overrides-consolidated.css).
 * ════════════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────
   CTA primary : palette Brand (violet/blue vibrant)
   ────────────────────────────────────────────────────────────── */

.sf-btn-primary,
button.sf-btn-primary,
[data-btn-primary="true"],
.btn-primary-violet,
button[type="submit"]:not([disabled]):not(.btn-secondary):not(.btn-ghost):not(.btn-outline) {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%) !important;
  background-color: #6d28d9 !important;
  color: #ffffff !important;
  border: none !important;
  text-shadow: none !important;
}

.sf-btn-primary *,
button.sf-btn-primary *,
[data-btn-primary="true"] *,
.btn-primary-violet * {
  color: #ffffff !important;
}

.sf-btn-primary:hover,
[data-btn-primary="true"]:hover,
.btn-primary-violet:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #4338ca 100%) !important;
  color: #ffffff !important;
}

/* ──────────────────────────────────────────────────────────────
   Force white text on DARK button backgrounds (Tailwind classes
   ou inline style) — empeche le doom loop "texte fonce invisible"
   ────────────────────────────────────────────────────────────── */

button.bg-black,
button.bg-gray-900,
button.bg-slate-900,
button.bg-zinc-900,
button.bg-neutral-900,
button.bg-stone-900,
button.bg-violet-700,
button.bg-violet-800,
button.bg-violet-900,
button.bg-purple-700,
button.bg-purple-800,
button.bg-purple-900,
button.bg-indigo-700,
button.bg-indigo-800,
button.bg-indigo-900,
button.bg-blue-700,
button.bg-blue-800,
button.bg-blue-900,
button.bg-red-700,
button.bg-red-800,
button.bg-red-900,
button.bg-emerald-700,
button.bg-emerald-800,
button.bg-emerald-900,
button.bg-green-700,
button.bg-green-800,
button.bg-green-900 {
  color: #ffffff !important;
}

button.bg-black *,
button.bg-gray-900 *,
button.bg-slate-900 *,
button.bg-zinc-900 *,
button.bg-violet-700 *,
button.bg-violet-800 *,
button.bg-violet-900 *,
button.bg-purple-700 *,
button.bg-purple-800 *,
button.bg-purple-900 *,
button.bg-indigo-700 *,
button.bg-indigo-800 *,
button.bg-indigo-900 *,
button.bg-blue-700 *,
button.bg-blue-800 *,
button.bg-blue-900 *,
button.bg-red-700 *,
button.bg-red-800 *,
button.bg-red-900 *,
button.bg-emerald-700 *,
button.bg-emerald-800 *,
button.bg-emerald-900 *,
button.bg-green-700 *,
button.bg-green-800 *,
button.bg-green-900 * {
  color: #ffffff !important;
}

/* Boutons inline avec gradient violet/indigo */
button[style*="linear-gradient(135deg, #7c3aed"],
button[style*="linear-gradient(135deg, #6d28d9"],
button[style*="linear-gradient(135deg, #4f46e5"],
button[style*="linear-gradient(135deg, #4338ca"],
button[style*="linear-gradient(135deg, #1e3a8a"],
a[style*="linear-gradient(135deg, #7c3aed"],
a[style*="linear-gradient(135deg, #4f46e5"] {
  color: #ffffff !important;
}

button[style*="linear-gradient(135deg, #7c3aed"] *,
button[style*="linear-gradient(135deg, #6d28d9"] *,
button[style*="linear-gradient(135deg, #4f46e5"] *,
button[style*="linear-gradient(135deg, #4338ca"] *,
a[style*="linear-gradient(135deg, #7c3aed"] *,
a[style*="linear-gradient(135deg, #4f46e5"] * {
  color: #ffffff !important;
}

/* Boutons inline avec background-color sombre force */
button[style*="background-color: #000"],
button[style*="background-color: #111"],
button[style*="background-color: #0f172a"],
button[style*="background-color: #1e293b"],
button[style*="background-color: #1f2937"],
button[style*="background-color: #6d28d9"],
button[style*="background-color: #7c3aed"],
button[style*="background-color: #4f46e5"],
button[style*="background-color: #1e3a8a"] {
  color: #ffffff !important;
}

/* ──────────────────────────────────────────────────────────────
   Force dark text on LIGHT button backgrounds (anti-AI-slop) :
   empeche un text-white sur fond blanc.
   ────────────────────────────────────────────────────────────── */

button.bg-white,
button.bg-gray-50,
button.bg-gray-100,
button.bg-slate-50,
button.bg-slate-100,
button.bg-neutral-50 {
  color: #0f172a !important;
}

/* MAIS si l'auteur a explicitement mis text-white sur ces fonds clairs
   il y a une erreur — on ignore le text-white et on force noir. */
button.bg-white.text-white,
button.bg-gray-50.text-white,
button.bg-gray-100.text-white,
button.bg-slate-50.text-white {
  color: #0f172a !important;
}

/* ──────────────────────────────────────────────────────────────
   Banner cropping fix : forces "object-fit: contain" pour les
   bandeaux d'identite vendeur (shop) et bannieres premium.
   ────────────────────────────────────────────────────────────── */

.vendor-banner-img,
img.vendor-banner-img,
[data-testid="vendor-banner"] img {
  object-fit: contain !important;
  object-position: center center !important;
  background-color: #0f172a;
}

/* Gold/Silver banner images : already use contain, on renforce. */
.gold-ad-image img,
.silver-ad-image img {
  object-fit: contain !important;
  object-position: center center !important;
}

/* ──────────────────────────────────────────────────────────────
   Cas particulier : header-mobile sticky + StatusPage etc.
   On force du text blanc sur fond noir bien lisible.
   ────────────────────────────────────────────────────────────── */

header.bg-slate-900,
header.bg-gray-900,
nav.bg-slate-900,
nav.bg-gray-900 {
  color: #ffffff !important;
}

header.bg-slate-900 a,
header.bg-slate-900 button,
header.bg-gray-900 a,
header.bg-gray-900 button {
  color: #ffffff !important;
}
