/* ===================== AUDIO TOGGLE BUTTON ===================== */

.hero-audio-toggle {
    position: fixed;
    bottom: 28px;
    left: 28px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 10px 4px;
    transition: transform 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.hero-audio-toggle.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    transition: opacity 0.6s ease 0.3s, transform 0.6s ease 0.3s;
}

.hero-audio-toggle:hover {
    transform: translateY(-1px);
}

/* ---- Sound Wave Icon (SVG bars) ---- */
.audio-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    position: relative;
}

.audio-icon .sound-bars {
    display: flex;
    align-items: center;
    gap: 2.5px;
    height: 18px;
}

.audio-icon .sound-bar {
    width: 2.5px;
    border-radius: 2px;
    background: linear-gradient(180deg, #d4af37 0%, #c1a773 40%, #f0d78c 70%, #c1a773 100%);
    transform-origin: center;
    transition: height 0.4s ease, opacity 0.3s ease;
}

/* Bar heights when active (playing) — animated */
.hero-audio-toggle.is-playing .sound-bar:nth-child(1) { animation: audioBar1 1.1s ease-in-out infinite; }
.hero-audio-toggle.is-playing .sound-bar:nth-child(2) { animation: audioBar2 0.9s ease-in-out infinite 0.1s; }
.hero-audio-toggle.is-playing .sound-bar:nth-child(3) { animation: audioBar3 1.0s ease-in-out infinite 0.2s; }
.hero-audio-toggle.is-playing .sound-bar:nth-child(4) { animation: audioBar4 0.8s ease-in-out infinite 0.15s; }
.hero-audio-toggle.is-playing .sound-bar:nth-child(5) { animation: audioBar5 1.2s ease-in-out infinite 0.05s; }

/* Static bar heights when muted */
.hero-audio-toggle:not(.is-playing) .sound-bar:nth-child(1) { height: 5px; }
.hero-audio-toggle:not(.is-playing) .sound-bar:nth-child(2) { height: 8px; }
.hero-audio-toggle:not(.is-playing) .sound-bar:nth-child(3) { height: 12px; }
.hero-audio-toggle:not(.is-playing) .sound-bar:nth-child(4) { height: 8px; }
.hero-audio-toggle:not(.is-playing) .sound-bar:nth-child(5) { height: 5px; }

/* Muted state: reduce opacity on bars */
.hero-audio-toggle:not(.is-playing) .sound-bar {
    opacity: 0.45;
    background: linear-gradient(180deg, #a08a5c 0%, #8a7a5a 100%);
}

/* ---- Keyframes for animated bars ---- */
@keyframes audioBar1 {
    0%, 100% { height: 5px; }
    50% { height: 14px; }
}
@keyframes audioBar2 {
    0%, 100% { height: 10px; }
    50% { height: 18px; }
}
@keyframes audioBar3 {
    0%, 100% { height: 14px; }
    50% { height: 6px; }
}
@keyframes audioBar4 {
    0%, 100% { height: 8px; }
    50% { height: 16px; }
}
@keyframes audioBar5 {
    0%, 100% { height: 6px; }
    50% { height: 12px; }
}

/* ---- Golden glow pulse on icon when playing ---- */
.hero-audio-toggle.is-playing .audio-icon::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.25) 0%, transparent 70%);
    animation: audioGlow 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes audioGlow {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.15); }
}

/* ---- Audio Label Text ---- */
.audio-label {
    position: relative;
    font-family: 'Instrument Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #c1a773;
    line-height: 1;
    transition: color 0.3s ease;
}

/* Dim the text a bit when muted */
.hero-audio-toggle:not(.is-playing) .audio-label {
    color: rgba(193, 167, 115, 0.55);
}

/* ---- Hover effects ---- */
.hero-audio-toggle:hover .audio-label {
    color: #d4af37;
}

.hero-audio-toggle:hover .sound-bar {
    background: linear-gradient(180deg, #f0d78c 0%, #d4af37 50%, #c1a773 100%) !important;
    opacity: 1 !important;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .hero-audio-toggle {
        bottom: 24px;
        left: 20px;
        padding: 8px 4px;
        gap: 8px;
    }

    .audio-icon {
        width: 18px;
        height: 18px;
    }

    .audio-icon .sound-bars {
        height: 14px;
        gap: 2px;
    }

    .audio-icon .sound-bar {
        width: 2px;
    }

    .audio-label {
        font-size: 9px;
        letter-spacing: 2px;
    }
}

@media (max-width: 480px) {
    .hero-audio-toggle {
        bottom: 20px;
        left: 16px;
        padding: 7px 4px;
    }
}
