/* Sticky Audio Player - Design Circolare Minimale */

.sticky-audio-player {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    animation: fadeInUp 0.5s ease-out;
}

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

/* Pulsante circolare - sempre visibile, semi-trasparente */
.audio-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    padding: 0;
    outline: none;
    position: relative;
}

.audio-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.audio-toggle:active {
    transform: scale(0.98);
}

/* Icona Play SVG */
.audio-toggle svg {
    width: 24px;
    height: 24px;
    transition: opacity 0.2s ease;
}

.audio-toggle .icon-play {
    opacity: 1;
    position: absolute;
}

.audio-toggle.playing .icon-play {
    opacity: 0;
}

/* Equalizer - barrette animate quando è in riproduzione */
.equalizer {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    height: 24px;
    position: absolute;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.audio-toggle.playing .equalizer {
    opacity: 1;
}

.equalizer .bar {
    width: 3px;
    background: #ffffff;
    border-radius: 2px;
    animation-duration: 0.8s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
}

.equalizer .bar1 {
    height: 60%;
    animation-name: equalizerBar1;
}

.equalizer .bar2 {
    height: 40%;
    animation-name: equalizerBar2;
    animation-delay: 0.2s;
}

.equalizer .bar3 {
    height: 80%;
    animation-name: equalizerBar3;
    animation-delay: 0.4s;
}

.equalizer .bar4 {
    height: 50%;
    animation-name: equalizerBar4;
    animation-delay: 0.6s;
}

@keyframes equalizerBar1 {
    0%, 100% { height: 60%; }
    50% { height: 20%; }
}

@keyframes equalizerBar2 {
    0%, 100% { height: 40%; }
    50% { height: 90%; }
}

@keyframes equalizerBar3 {
    0%, 100% { height: 80%; }
    50% { height: 30%; }
}

@keyframes equalizerBar4 {
    0%, 100% { height: 50%; }
    50% { height: 70%; }
}

/* Focus accessibilità */
.audio-toggle:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Responsive: dimensioni ridotte su mobile */
@media screen and (max-width: 768px) {
    .sticky-audio-player {
        bottom: 20px;
        right: 20px;
    }

    .audio-toggle {
        width: 50px;
        height: 50px;
    }

    .audio-toggle svg {
        width: 20px;
        height: 20px;
    }

    .equalizer {
        height: 20px;
    }

    .equalizer .bar {
        width: 2.5px;
        gap: 2px;
    }
}

/* Nascondi nell'admin di WordPress */
body.wp-admin .sticky-audio-player {
    display: none;
}
