/* Reset e Body */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 🎨 PULSANTE ULTRA AVANZATO */
:root {
    --btn-primary-color: #B026FF;
    --btn-secondary-color: #8B1FD9;
    --btn-accent-color: #E066FF;
}

a.btn_animate_border,
button.btn_animate_border {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--btn-secondary-color), var(--btn-primary-color));
    padding: 22px 55px;
    font-size: 1.2em;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 
        0 8px 32px rgba(176, 38, 255, .3),
        0 0 0 1px rgba(255, 255, 255, .1) inset,
        0 0 60px rgba(176, 38, 255, .2),
        0 0 20px rgba(176, 38, 255, .4);
    overflow: hidden;
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    transform-style: preserve-3d;
    border: none;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    filter: drop-shadow(0 0 10px rgba(176, 38, 255, 0.5));
}

/* Hover */
a.btn_animate_border:hover,
button.btn_animate_border:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 15px 50px rgba(176, 38, 255, .5),
        0 0 0 2px rgba(255, 255, 255, .2) inset,
        0 0 100px rgba(176, 38, 255, .4),
        0 0 30px rgba(176, 38, 255, .6),
        0 0 60px rgba(176, 38, 255, .4),
        inset 0 0 30px rgba(176, 38, 255, .2);
    background: linear-gradient(135deg, #9D1FE6, #C830FF);
    animation: neonPulse 2s ease-in-out infinite;
}

/* Click con Effetto Neon Intensificato */
a.btn_animate_border:active,
button.btn_animate_border:active {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 5px 20px rgba(176, 38, 255, .6),
        0 0 0 1px rgba(255, 255, 255, .15) inset,
        0 0 80px rgba(176, 38, 255, .8),
        0 0 120px rgba(176, 38, 255, .6),
        inset 0 0 40px rgba(176, 38, 255, .4);
    filter: brightness(1.2) drop-shadow(0 0 30px rgba(176, 38, 255, 1));
}

/* Effetto Shine */
a.btn_animate_border::before,
button.btn_animate_border::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .3), transparent);
    transition: left 0.5s;
}

a.btn_animate_border:hover::before,
button.btn_animate_border:hover::before {
    left: 100%;
}

/* Glassmorphism */
a.btn_animate_border::after,
button.btn_animate_border::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .15) 0%, transparent 50%, rgba(0, 0, 0, .1) 100%);
    border-radius: 10px;
    pointer-events: none;
}

/* Bordi Animati con Effetto Neon */
a.btn_animate_border span:nth-child(1),
button.btn_animate_border span:nth-child(1) {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, transparent, #ffffff, transparent);
    animation: animate1 3s linear infinite;
    filter: drop-shadow(0 0 8px #ffffff) drop-shadow(0 0 15px rgba(176, 38, 255, 1)) drop-shadow(0 0 25px rgba(176, 38, 255, 0.8));
    box-shadow: 0 0 10px rgba(176, 38, 255, 0.8), 0 0 20px rgba(176, 38, 255, 0.6);
}

a.btn_animate_border span:nth-child(2),
button.btn_animate_border span:nth-child(2) {
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, #ffffff, transparent);
    animation: animate2 3s linear infinite;
    animation-delay: 0.75s;
    filter: drop-shadow(0 0 8px #ffffff) drop-shadow(0 0 15px rgba(176, 38, 255, 1)) drop-shadow(0 0 25px rgba(176, 38, 255, 0.8));
    box-shadow: 0 0 10px rgba(176, 38, 255, 0.8), 0 0 20px rgba(176, 38, 255, 0.6);
}

a.btn_animate_border span:nth-child(3),
button.btn_animate_border span:nth-child(3) {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to left, transparent, #ffffff, transparent);
    animation: animate3 3s linear infinite;
    animation-delay: 1.5s;
    filter: drop-shadow(0 0 8px #ffffff) drop-shadow(0 0 15px rgba(176, 38, 255, 1)) drop-shadow(0 0 25px rgba(176, 38, 255, 0.8));
    box-shadow: 0 0 10px rgba(176, 38, 255, 0.8), 0 0 20px rgba(176, 38, 255, 0.6);
}

a.btn_animate_border span:nth-child(4),
button.btn_animate_border span:nth-child(4) {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to top, transparent, #ffffff, transparent);
    animation: animate4 3s linear infinite;
    animation-delay: 2.25s;
    filter: drop-shadow(0 0 8px #ffffff) drop-shadow(0 0 15px rgba(176, 38, 255, 1)) drop-shadow(0 0 25px rgba(176, 38, 255, 0.8));
    box-shadow: 0 0 10px rgba(176, 38, 255, 0.8), 0 0 20px rgba(176, 38, 255, 0.6);
}

/* Particelle con Effetto Neon */
a.btn_animate_border .particle,
button.btn_animate_border .particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ffffff;
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 4s infinite;
    box-shadow: 
        0 0 10px #ffffff,
        0 0 20px rgba(176, 38, 255, 1),
        0 0 30px rgba(176, 38, 255, 0.8),
        0 0 40px rgba(176, 38, 255, 0.6);
    filter: drop-shadow(0 0 5px rgba(176, 38, 255, 1));
}

a.btn_animate_border .particle:nth-child(5),
button.btn_animate_border .particle:nth-child(5) {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

a.btn_animate_border .particle:nth-child(6),
button.btn_animate_border .particle:nth-child(6) {
    top: 60%;
    left: 80%;
    animation-delay: 1s;
}

a.btn_animate_border .particle:nth-child(7),
button.btn_animate_border .particle:nth-child(7) {
    top: 80%;
    left: 40%;
    animation-delay: 2s;
}

/* Testo con Effetto Neon */
a.btn_animate_border .btn-text,
button.btn_animate_border .btn-text {
    position: relative;
    z-index: 2;
    text-shadow: 
        0 2px 10px rgba(0, 0, 0, .3),
        0 0 10px rgba(176, 38, 255, 0.5);
    transition: all 0.3s ease;
}

a.btn_animate_border:hover .btn-text,
button.btn_animate_border:hover .btn-text {
    text-shadow: 
        0 0 20px rgba(255, 255, 255, .8),
        0 0 30px rgba(176, 38, 255, 1),
        0 0 40px rgba(176, 38, 255, 0.8),
        0 0 50px rgba(176, 38, 255, 0.6);
    letter-spacing: 3px;
    animation: textNeonGlow 2s ease-in-out infinite;
}

@keyframes textNeonGlow {
    0%, 100% {
        text-shadow: 
            0 0 20px rgba(255, 255, 255, .8),
            0 0 30px rgba(176, 38, 255, 1),
            0 0 40px rgba(176, 38, 255, 0.8),
            0 0 50px rgba(176, 38, 255, 0.6);
    }
    50% {
        text-shadow: 
            0 0 30px rgba(255, 255, 255, 1),
            0 0 40px rgba(176, 38, 255, 1),
            0 0 60px rgba(176, 38, 255, 1),
            0 0 80px rgba(176, 38, 255, 0.8);
    }
}

/* Icona con Effetto Neon */
a.btn_animate_border .btn-icon,
button.btn_animate_border .btn-icon {
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .3)) drop-shadow(0 0 8px rgba(176, 38, 255, 0.5));
}

a.btn_animate_border:hover .btn-icon,
button.btn_animate_border:hover .btn-icon {
    transform: translateX(5px) scale(1.1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .3)) 
            drop-shadow(0 0 15px rgba(176, 38, 255, 1))
            drop-shadow(0 0 25px rgba(176, 38, 255, 0.8));
    animation: iconNeonPulse 1.5s ease-in-out infinite;
}

@keyframes iconNeonPulse {
    0%, 100% {
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .3)) 
                drop-shadow(0 0 15px rgba(176, 38, 255, 1))
                drop-shadow(0 0 25px rgba(176, 38, 255, 0.8));
    }
    50% {
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .3)) 
                drop-shadow(0 0 25px rgba(176, 38, 255, 1))
                drop-shadow(0 0 40px rgba(176, 38, 255, 1));
    }
}

/* Effetto Neon Pulse */
@keyframes neonPulse {
    0%, 100% {
        box-shadow: 
            0 15px 50px rgba(176, 38, 255, .5),
            0 0 0 2px rgba(255, 255, 255, .2) inset,
            0 0 100px rgba(176, 38, 255, .4),
            0 0 30px rgba(176, 38, 255, .6),
            0 0 60px rgba(176, 38, 255, .4),
            inset 0 0 30px rgba(176, 38, 255, .2);
    }
    50% {
        box-shadow: 
            0 15px 50px rgba(176, 38, 255, .8),
            0 0 0 2px rgba(255, 255, 255, .3) inset,
            0 0 150px rgba(176, 38, 255, .6),
            0 0 50px rgba(176, 38, 255, .8),
            0 0 90px rgba(176, 38, 255, .6),
            inset 0 0 50px rgba(176, 38, 255, .3);
    }
}

/* Animazioni */
@keyframes animate1 {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes animate2 {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

@keyframes animate3 {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

@keyframes animate4 {
    0% { transform: translateY(100%); }
    100% { transform: translateY(-100%); }
}

@keyframes particleFloat {
    0%, 100% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-30px) scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    a.btn_animate_border,
    button.btn_animate_border {
        padding: 18px 40px;
        font-size: 1em;
    }
}

/* Focus con Effetto Neon */
a.btn_animate_border:focus,
button.btn_animate_border:focus {
    outline: 3px solid var(--btn-accent-color);
    outline-offset: 4px;
    box-shadow: 
        0 8px 32px rgba(176, 38, 255, .3),
        0 0 0 1px rgba(255, 255, 255, .1) inset,
        0 0 60px rgba(176, 38, 255, .2),
        0 0 20px rgba(176, 38, 255, .4),
        0 0 0 3px rgba(176, 38, 255, 0.6);
    filter: drop-shadow(0 0 15px rgba(176, 38, 255, 0.8));
}

/* Varianti di dimensione */
a.btn_animate_border.small,
button.btn_animate_border.small {
    padding: 15px 30px;
    font-size: 0.9em;
}

a.btn_animate_border.large,
button.btn_animate_border.large {
    padding: 25px 65px;
    font-size: 1.3em;
}

/* Variante senza testo uppercase */
a.btn_animate_border.no-uppercase,
button.btn_animate_border.no-uppercase {
    text-transform: none;
    letter-spacing: normal;
}
