/* Logo Animation System */

/* Base logo container */
.logo-icon {
    transition: transform 0.3s ease, filter 0.3s ease;
    will-change: transform;
}

/* Enhanced hover state */
.nav-logo:hover .logo-icon {
    transform: scale(1.02);
    filter: brightness(1.05);
}

/* Waveform intensity boost on hover */
.nav-logo:hover .logo-icon #waveform rect,
.nav-logo:hover .logo-icon #miniWaveform rect,
.nav-logo:hover .logo-icon #waveformStacked rect {
    animation-duration: 0.8s !important;
    opacity: 1 !important;
}

/* Page load animation - fade in + slide */
@keyframes logoFadeInSlide {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.logo-icon {
    animation: logoFadeInSlide 0.6s ease-out;
}

/* Waveform sweep animation on page load */
@keyframes waveSweep {
    0% {
        opacity: 0;
        transform: scaleY(0.3);
    }
    60% {
        opacity: 1;
        transform: scaleY(1.1);
    }
    100% {
        opacity: 1;
        transform: scaleY(1);
    }
}

/* Apply sweep to waveform bars with staggered delay */
.logo-icon #waveform rect:nth-child(1),
.logo-icon #miniWaveform rect:nth-child(1),
.logo-icon #waveformStacked rect:nth-child(1) {
    animation: waveSweep 0.6s ease-out 0.1s backwards;
}

.logo-icon #waveform rect:nth-child(2),
.logo-icon #miniWaveform rect:nth-child(2),
.logo-icon #waveformStacked rect:nth-child(2) {
    animation: waveSweep 0.6s ease-out 0.15s backwards;
}

.logo-icon #waveform rect:nth-child(3),
.logo-icon #miniWaveform rect:nth-child(3),
.logo-icon #waveformStacked rect:nth-child(3) {
    animation: waveSweep 0.6s ease-out 0.2s backwards;
}

.logo-icon #waveform rect:nth-child(4),
.logo-icon #miniWaveform rect:nth-child(4),
.logo-icon #waveformStacked rect:nth-child(4) {
    animation: waveSweep 0.6s ease-out 0.25s backwards;
}

.logo-icon #waveform rect:nth-child(5),
.logo-icon #miniWaveform rect:nth-child(5),
.logo-icon #waveformStacked rect:nth-child(5) {
    animation: waveSweep 0.6s ease-out 0.3s backwards;
}

.logo-icon #waveform rect:nth-child(6),
.logo-icon #miniWaveform rect:nth-child(6),
.logo-icon #waveformStacked rect:nth-child(6) {
    animation: waveSweep 0.6s ease-out 0.35s backwards;
}

.logo-icon #waveform rect:nth-child(7),
.logo-icon #miniWaveform rect:nth-child(7),
.logo-icon #waveformStacked rect:nth-child(7) {
    animation: waveSweep 0.6s ease-out 0.4s backwards;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .logo-icon {
        animation: none;
    }

    .logo-icon #waveform rect,
    .logo-icon #miniWaveform rect,
    .logo-icon #waveformStacked rect {
        animation: none !important;
    }

    .nav-logo:hover .logo-icon {
        transform: none;
    }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .nav-logo:hover .logo-icon {
        filter: brightness(1.15);
    }
}
