/* --- CORE SETUP --- */
body {
    font-family: 'Outfit', sans-serif;
    background-color: #050505;
    margin: 0;
    padding: 0;
}

.font-space {
    font-family: 'Space Grotesk', sans-serif;
}

/* --- FLUID BACKGROUND ENGINE --- */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1; /* SPOSTATO DIETRO: risolve il problema della nebbia sulla Navbar */
    overflow: hidden;
    background: #050505;
    pointer-events: none;
}

.gradient-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px); /* Aumentato per un effetto più soffuso */
    opacity: 0.4; /* Ridotta opacità per non bruciare i contenuti */
    animation: float-around 25s infinite ease-in-out alternate;
}

.sphere-1 {
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(6,182,212,0.35) 0%, rgba(0,0,0,0) 70%);
    top: -25%; /* Alzata per liberare la visuale sulla navigazione */
    left: -10%;
}

.sphere-2 {
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(168,85,247,0.3) 0%, rgba(0,0,0,0) 70%);
    bottom: -15%;
    right: -10%;
    animation-delay: -5s;
}

.sphere-3 {
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, rgba(236,72,153,0.2) 0%, rgba(0,0,0,0) 70%);
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes float-around {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, 60px) scale(1.1); }
    100% { transform: translate(-20px, -20px) scale(1); }
}

/* Backdrop Blur Layer per uniformare lo sfondo */
.backdrop-blur-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    backdrop-filter: blur(40px);
    pointer-events: none;
}

/* --- MAP DARK CONFIGURATION --- */
/* Prevenzione flash bianco e stile notturno */
.dark-map-iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background-color: #080808; /* Colore di caricamento */
    /* Filtri per stile Cyberpunk/Dark */
    filter: grayscale(1) invert(0.92) contrast(1.2) hue-rotate(180deg);
    transition: filter 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-map-iframe:hover {
    filter: grayscale(0.4) invert(0.92) contrast(1.2) hue-rotate(180deg);
}

/* --- MAGIC CARD EFFECT --- */
.magic-card {
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 24px;
    position: relative;
    padding: 1.5px;
    overflow: hidden;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.magic-card:hover {
    transform: translateY(-8px);
}

.magic-content {
    background: #0a0a0a;
    border-radius: 22px;
    padding: 2.5rem;
    height: 100%;
    position: relative;
    z-index: 2;
}

.magic-border {
    background: radial-gradient(
        500px circle at var(--mouse-x) var(--mouse-y), 
        rgba(255, 255, 255, 0.35),
        transparent 45%
    );
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.5s;
    z-index: 1;
}

.magic-card:hover .magic-border {
    opacity: 1;
}

/* --- NAV PILLS --- */
.nav-pill {
    padding: 0.6rem 1.4rem;
    border-radius: 99px;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
    transition: all 0.3s ease;
}

.nav-pill:hover, .nav-pill.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* --- ANIMATIONS & UTILITIES --- */
@keyframes scrollText {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.marquee-track {
    animation: scrollText 35s linear infinite;
}

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

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

/* Scrollbar Custom */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #050505; }
::-webkit-scrollbar-thumb { background: #222; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #333; }

/* Utilities per testi responsive */
.text-balance {
    text-wrap: balance;
}

/* --- WHATSAPP FLOATING BUTTON --- */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25d366; /* Verde originale WhatsApp */
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.whatsapp-float:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 30px rgba(37, 211, 102, 0.6);
    background-color: #20ba5a;
}

/* Tooltip che appare al passaggio del mouse */
.whatsapp-tooltip {
    position: absolute;
    right: 80px;
    background: white;
    color: black;
    padding: 8px 15px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.whatsapp-float:hover .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
    right: 70px;
}

/* Animazione pulsante per attirare l'attenzione */
@keyframes pulse-whatsapp {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.whatsapp-float {
    animation: pulse-whatsapp 2s infinite;
}

/* --- MOBILE OPTIMIZATIONS --- */
@media (max-width: 768px) {
    /* Riduciamo le sezioni per il pollice (Thumb Zone) */
    section {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }

    /* Le card magiche occupano tutta la larghezza con meno padding interno */
    .magic-content {
        padding: 1.5rem !important;
    }

    /* La mappa deve essere leggermente meno alta su mobile per facilitare lo scroll */
    .dark-map-iframe {
        height: 300px !important;
    }

    /* Evitiamo che le sfere di sfondo disturbino troppo la lettura su schermi piccoli */
    .gradient-sphere {
        filter: blur(60px);
        opacity: 0.25;
    }
}