/* 
 * Thème Féerique Swiss - SlabForge / Swiss SlabForge
 * Patch 01_112 - Intégration v4 - VERSION FINALE
 */

/* =====================================
   BACKGROUND MAGIQUE - IMAGE PERSONNALISÉE
   ===================================== */

/* Fond blanc tout derrière (dernier plan) */
html {
  background: #ffffff !important;
}

/* Body - fond blanc (theme-overrides.css gère l'image via ::before) 
   IMPORTANT: Ne pas mettre background transparent ici! */
body {
  position: relative;
  min-height: 100vh;
  /* background géré par theme-overrides.css */
}

/* Plus besoin de body::before */

/* Plus besoin de theme-night */

/* Root et tous les containers TRANSPARENTS - SAUF CAROUSELS ET BULLES INSCRIPTION */
#root,
.main-content-wrapper,
main {
  background: transparent !important;
}

/* Les sections qui NE SONT PAS des carousels ou des zones d'inscription */
section:not([id="boosted-items"]):not([id="new-items"]):not([id="auctions"]):not([style*="rgb(255, 255, 255)"]):not([style*="rgb(179, 242, 242)"]) {
  background: transparent !important;
}

/* IMPORTANT: Ne PAS rendre les divs des cartes transparents */
div:not(.card):not(.product-card):not(.product-card-uniform):not(header *):not(footer *):not([class*="carousel"]):not([class*="advertising"]):not([style*="background-color"]):not(.bg-white):not([class*="group"]):not([data-ad="gold"]):not([data-ad="silver"]):not(.ad-slot-gold):not(.ad-slot-silver):not(.ad-cta-btn) {
  background: transparent !important;
}

[class*="max-w-"]:not([style*="background-color"]),
[class*="container"]:not([style*="background-color"]),
[class*="wrapper"]:not([style*="background-color"]) {
  background: transparent !important;
}

/* =====================================
   Z-INDEX LAYERS (ORDRE DE SUPERPOSITION)
   ===================================== */

/* Header au-dessus de tout */
header {
  z-index: 100 !important;
}

/* Personnages BD derrière le header mais devant le contenu */
[class*="character"],
[class*="SectionCharacter"],
img[src*="Barbe"],
img[src*="Gris"],
img[src*="Rose"],
img[src*="Jaune"],
img[src*="Prof"],
img[src*="Rouge"],
img[src*="Vert"] {
  z-index: 50 !important;
  position: relative;
}

/* Contenu normal */
main,
section {
  z-index: 10 !important;
  position: relative;
}

/* =====================================
   CONTAINERS BLANCS/GRIS
   ===================================== */

/* Header - Fond blanc opaque */
header {
  background: #ffffff !important;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Footer - FOND BLANC OPAQUE */
footer {
  background: #ffffff !important;
  border-top: 1px solid #e5e7eb;
}

footer > div,
footer section,
footer [class*="container"],
footer [class*="grid"] > * {
  background: transparent !important;
}

/* Carrousels - Fond BLEU #0AA9F0 FORCÉ */
.carousel-container,
[class*="carousel"],
section[class*="carousel"],
div[class*="carousel"],
section[id="boosted-items"],
section[id="new-items"],
section[id="auctions"],
section:has(h2:contains("Objets")),
section:has(h3:contains("Objets")),
section:has(h2:contains("Nouveautés")),
section:has(h2:contains("Enchères")),
section[style*="#0AA9F0"] {
  background: #0AA9F0 !important;
  background-color: #0AA9F0 !important;
  opacity: 1 !important;
  padding: 2rem !important;
  border-radius: 16px !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
  margin: 2rem 0 !important;
}

/* Forcer tous les enfants directs des carrousels à avoir fond transparent */
.carousel-container > *:not(.card):not(.product-card),
[class*="carousel"] > *:not(.card):not(.product-card) {
  background: transparent !important;
}

/* Titre des carrousels en noir */
.carousel-container h2,
.carousel-container h3,
[class*="carousel"] h2,
[class*="carousel"] h3 {
  color: #000000 !important;
}

/* IMPORTANT: Cartes DANS les carrousels = BLANC PUR TOTAL */
.carousel-container .card,
.carousel-container .product-card,
.carousel-container .product-card-uniform,
.carousel-container article,
[class*="carousel"] .card,
[class*="carousel"] .product-card,
[class*="carousel"] .product-card-uniform,
[class*="carousel"] article,
[class*="carousel"] > div > .card,
[class*="carousel"] > div > .product-card,
[class*="carousel"] > div > .product-card-uniform,
section[style*="rgb(179, 242, 242)"] .card,
section[style*="rgb(179, 242, 242)"] .product-card,
section[style*="rgb(179, 242, 242)"] .product-card-uniform,
section[style*="rgb(179, 242, 242)"] article {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  opacity: 1 !important;
}

/* TOUTES les cartes de produits - BLANC TOTAL */
.card, 
.product-card,
.product-card-uniform,
article,
[role="article"],
[class*="product-"],
[class*="item-card"],
[class*="auction-card"] {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.3s ease;
  opacity: 1 !important;
}

.card:hover, 
.product-card:hover,
article:hover {
  background: #ffffff !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* Cases annonceurs/publicité - Fond BLANC */
[class*="advertising"],
[class*="banner"],
[class*="SideAdvertising"],
aside,
[role="complementary"] {
  background: #ffffff !important;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Section inscription - Fond blanc avec texte NOIR */
.hero-section,
[class*="hero"],
[class*="registration"],
[class*="cta"],
div[style*="rgb(255, 255, 255)"] {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border-radius: 20px;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  opacity: 1 !important;
}

.hero-section h1,
.hero-section h2,
.hero-section p,
[class*="hero"] h1,
[class*="hero"] h2,
[class*="hero"] p {
  color: #000000 !important;
}

/* Texte spécifique "Rejoignez Swiss SlabForge" en NOIR */
h1:contains("Rejoignez"),
h2:contains("Rejoignez"),
p:contains("Rejoignez") {
  color: #000000 !important;
  font-weight: 600;
}

/* FORCE FINALE: Tous les éléments avec style inline background bleu = OPAQUE 100% */
*[style*="#0AA9F0"] {
  background-color: #0AA9F0 !important;
  opacity: 1 !important;
}

/* FORCE ABSOLUE: Éléments avec #ffffff = BLANC PUR */
*[style*="#ffffff"],
*[style*="backgroundColor: #ffffff"] {
  background-color: #ffffff !important;
  opacity: 1 !important;
}

/* Tous les titres dans zones blanches en noir */
section[style*="background: #ffffff"] h1,
section[style*="background: #ffffff"] h2,
section[style*="background: #ffffff"] h3,
section[style*="background: white"] h1,
section[style*="background: white"] h2,
section[style*="background: white"] h3 {
  color: #000000 !important;
}

/* =====================================
   CARTES PRODUITS - BLANC FORCÉ ABSOLU
   ===================================== */

/* Sélecteurs ultra-spécifiques pour cartes */
div.product-card-uniform,
div.product-card,
div.card,
div[class*="product"],
article.product,
article[class*="item"],
div.bg-white.rounded-lg.shadow-md,
.carousel-container > div > div,
section[style*="242"] > div > div > div,
div.group.bg-white {
  background: #ffffff !important;
  background-color: #ffffff !important;
}
/* =====================================
   MODALS - BLEU #0AA9F0
   ===================================== */

[role="dialog"],
[class*="modal"]:not([class*="dropdown"]):not([class*="menu"]),
div[style*="#0AA9F0"] {
  background: #0AA9F0 !important;
  background-color: #0AA9F0 !important;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 200 !important;
  opacity: 1 !important;
}

/* =====================================
   DROPDOWNS - FOND BLANC
   ===================================== */

[class*="dropdown-menu"],
[class*="dropdown-content"],
[data-radix-popper-content-wrapper],
[data-radix-menu-content],
.dropdown {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 200 !important;
  opacity: 1 !important;
  border: 1px solid #e5e7eb;
}

/* Liens dans les dropdowns - texte visible */
[class*="dropdown-menu"] a,
[class*="dropdown-content"] a,
[data-radix-menu-content] a,
.dropdown a {
  color: #374151 !important;
  text-decoration: none;
}

[class*="dropdown-menu"] a:hover,
[class*="dropdown-content"] a:hover,
[data-radix-menu-content] a:hover,
.dropdown a:hover {
  color: #0AA9F0 !important;
  background-color: #f3f4f6 !important;
}

/* =====================================
   GRILLES - TRANSPARENT
   ===================================== */

[class*="grid"]:not(button):not(a):not([style*="background"]),
[class*="flex"]:not(button):not(a):not([class*="btn"]):not([style*="background"]) {
  background: transparent !important;
}

/* Items dans les grilles - GRIS CLAIR */
[class*="grid"] > .card,
[class*="grid"] > .product-card,
[class*="grid"] > article {
  background: #f8f9fa !important;
}

/* =====================================
   ANIMATIONS
   ===================================== */

@keyframes float-soft {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.animate-float-soft {
  animation: float-soft 4s ease-in-out infinite;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeIn {
  animation: fadeIn 0.5s ease-out;
}

/* =====================================
   RESPONSIVE
   ===================================== */

@media (max-width: 768px) {
  body {
    background-attachment: scroll;
  }
  
  .carousel-container {
    padding: 1rem;
    margin: 1rem 0;
  }
  
  [class*="advertising"],
  aside {
    padding: 1rem;
  }
}

/* =====================================
   ACCESSIBILITÉ
   ===================================== */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-color-scheme: dark) {
  body:not(.theme-day) {
    /* background-image: url('/assets/backgrounds/bg_night_1.jpeg'); */
    background: #ffffff !important; /* FOND BLANC même en dark mode */
  }
}

/* =====================================
   SCROLLBAR
   ===================================== */

::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: rgba(248, 249, 250, 0.5);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #93c5fd, #60a5fa);
  border-radius: 10px;
  border: 2px solid rgba(248, 249, 250, 0.5);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #60a5fa, #3b82f6);
}

body.theme-night::-webkit-scrollbar-track {
  background: rgba(30, 41, 59, 0.3);
}

body.theme-night::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #475569, #64748b);
  border-color: rgba(30, 41, 59, 0.3);
}


/* =====================================
   OMBRES FORTES SUR TOUS LES TITRES
   Pour améliorer la lisibilité sur le fond
   ===================================== */

/* Titres principaux (h1, h2) - PAS sur les boutons */
h1, h2, 
.text-xl:not(button), .text-2xl:not(button), .text-3xl:not(button), .text-4xl:not(button),
[class*="font-bold"]:not(button):not(a) {
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8) !important;
}

/* Sous-titres et textes secondaires - PAS sur les boutons ni inputs */
h3, h4,
[class*="font-semibold"]:not(button):not(a):not(input),
[class*="font-medium"]:not(button):not(a):not(input) {
  text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.7) !important;
}

/* Textes spécifiques des pages */
.page-title,
.section-title,
.search-result-title {
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8) !important;
}

/* =====================================
   FONDS BLANCS FORCÉS POUR REGISTER PAGE
   Cases Acheteur/Vendeur
   ===================================== */
label[style*="backgroundColor"] {
  background-color: #ffffff !important;
}


/* =====================================
   BOUTON ENCHÈRES LIVE CLIGNOTANT BLEU
   Animation: Bleu avec texte blanc <-> Blanc avec texte bleu
   ===================================== */
@keyframes encheres-blink-blue {
  0%, 100% {
    background-color: #0AA9F0;
    color: #ffffff;
    border-color: #0AA9F0;
  }
  50% {
    background-color: #ffffff;
    color: #0AA9F0;
    border-color: #0AA9F0;
  }
}

.encheres-live-btn {
  animation: encheres-blink-blue 1.5s ease-in-out infinite;
  opacity: 1 !important;
}
