@import "tailwindcss";

@theme {
  --animate-fade-up: fadeUp .2s ease both;
}

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

@utility fade-up { animation: var(--animate-fade-up); }
@utility fade-up-1 { animation-delay: .02s; }
@utility fade-up-2 { animation-delay: .04s; }
@utility fade-up-3 { animation-delay: .06s; }
@utility fade-up-4 { animation-delay: .08s; }
@utility fade-up-5 { animation-delay: .10s; }
@utility fade-up-6 { animation-delay: .12s; }

@utility scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
    &::-webkit-scrollbar { display: none; }
}

@utility nav-active {
    position: relative;
    &::after {
        content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
        height: 2px; background: #86efac; border-radius: 1px;
    }
}
/* ─────────────────────────────────────────────────────────
   MODIFICHE STRUTTURALI GLOBALI RO-BENZ (TAILWIND v4 FIX)
   ───────────────────────────────────────────────────────── */

@layer base {
    /* 1. Forza il bordo verde del brand sulla card con il trofeo (Più economico) */
    div.bg-white.rounded-2xl.border:has(span, div, text) {
        &:has(text:contains("🏆")), &:has(:contains("🏆")), &:has(.text-amber-500) {
            border-color: #15803d !important;
            border-width: 2px !important;
        }
    }
    
    /* Se la prima card è identificata da un bordo scuro specifico (es: border-slate-900 o border-black) */
    .border-slate-900, .border-slate-800, .border-black {
        border-color: #15803d !important;
        border-width: 2px !important;
    }

    /* 2. Ripristina il badge numerico mancante per il primo elemento */
    /* Il numero 1 si trova dentro la prima card che non ha il cerchio visibile */
    div.bg-white:first-of-type [class*="rounded-full"],
    div.bg-white:first-of-type .w-6.h-6,
    div.bg-white:first-of-type .w-7.h-7 {
        display: flex !important;
        background-color: #f8fafc !important; /* bg-slate-50 */
        border: 1px solid #e2e8f0 !important; /* border-slate-200 */
        color: #475569 !important;            /* text-slate-600 */
        width: 1.75rem !important;
        height: 1.75rem !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 9999px !important;
    }

    /* 3. Sistemazione del bottone attivo (Gasolio/Selezionato) */
    /* Colpisce l'elemento che ha testo bianco nascosto su sfondo bianco */
    .bg-brand-700, .bg-green-700, [class*="bg-brand-"] {
        &:not(header *):not(header) {
            background-color: #f0fdf4 !important; /* bg-green-50 */
            color: #15803d !important;            /* text-green-700 */
            border-color: #15803d !important;      /* border-green-700 */
            font-weight: 700 !important;
        }
    }
    
    /* Alternativa specifica se il bottone selezionato usa classi combinate che rimangono bianche */
    a[class*="text-white"][class*="bg-"]:not(header *),
    a[class*="bg-brand-"] {
        background-color: #f0fdf4 !important;
        color: #15803d !important;
        border-color: #15803d !important;
    }
}
/* ─────────────────────────────────────────────────────────
   AGGIORNAMENTO CONFIGURAZIONE FOOTER GLOBALE
   ───────────────────────────────────────────────────────── */

/* Intercetta il tag footer o il testo grigio dei link in basso */
footer a, 
.text-slate-500 a, 
.text-xs.text-slate-400 a {
    color: #15803d !important;         /* Verde green-700 dell'header */
    font-medium: 500;
    transition: color 0.15s ease-in-out;
    text-decoration: none;
}

/* Effetto al passaggio del mouse */
footer a:hover, 
.text-slate-500 a:hover, 
.text-xs.text-slate-400 a:hover {
    color: #16a34a !important;         /* Verde leggermente più chiaro (green-600) */
    text-decoration: underline !important;
}
