/* Animations */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
    }

    50% {
        box-shadow: 0 0 40px rgba(139, 92, 246, 0.8);
    }
}

@keyframes swirl {
    0% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(180deg) scale(1.1);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

@keyframes wave {

    0%,
    100% {
        height: 20px;
    }

    50% {
        height: 40px;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes equalizer {

    0%,
    100% {
        height: 30%;
    }

    50% {
        height: 80%;
    }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

.pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

.spinning {
    animation: spin 3s linear infinite;
}

/* Background */
.gradient-bg {
    background: #000000;
    position: relative;
    overflow: hidden;
}

/* Glass Effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Smoke Orbs */
.smoke-orb {
    position: absolute;
    mix-blend-mode: screen;
    filter: blur(100px);
    opacity: 0.6;
}

.smoke-orb-1 {
    top: -10%;
    left: 10%;
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse at center, #a855f7 0%, transparent 70%);
    animation: swirl 20s ease-in-out infinite, float-smoke-1 15s ease-in-out infinite;
}

.smoke-orb-2 {
    bottom: -10%;
    right: 15%;
    width: 700px;
    height: 500px;
    background: radial-gradient(ellipse at center, #8b5cf6 0%, transparent 70%);
    animation: swirl 25s ease-in-out infinite reverse, float-smoke-2 18s ease-in-out infinite;
}

.smoke-orb-3 {
    top: 30%;
    right: 20%;
    width: 500px;
    height: 350px;
    background: radial-gradient(ellipse at center, #9333ea 0%, transparent 70%);
    animation: swirl 30s ease-in-out infinite, float-smoke-3 20s ease-in-out infinite;
}

.smoke-orb-4 {
    bottom: 40%;
    left: 15%;
    width: 550px;
    height: 400px;
    background: radial-gradient(ellipse at center, #7c3aed 0%, transparent 70%);
    animation: swirl 22s ease-in-out infinite reverse, float-smoke-4 17s ease-in-out infinite;
}

@keyframes float-smoke-1 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(30px, -20px) rotate(5deg);
    }

    50% {
        transform: translate(-20px, -40px) rotate(-3deg);
    }

    75% {
        transform: translate(40px, -30px) rotate(7deg);
    }
}

@keyframes float-smoke-2 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(-40px, 30px) rotate(-5deg);
    }

    50% {
        transform: translate(30px, 50px) rotate(4deg);
    }

    75% {
        transform: translate(-30px, 40px) rotate(-6deg);
    }
}

@keyframes float-smoke-3 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(-30px, 25px) rotate(4deg);
    }

    66% {
        transform: translate(35px, -20px) rotate(-5deg);
    }
}

@keyframes float-smoke-4 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    30% {
        transform: translate(25px, -30px) rotate(-4deg);
    }

    60% {
        transform: translate(-35px, 25px) rotate(6deg);
    }
}

/* Wave Bars */
.wave-bar {
    display: inline-block;
    width: 4px;
    height: 20px;
    margin: 0 2px;
    background: currentColor;
    animation: wave 1s ease-in-out infinite;
}

.wave-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.wave-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.wave-bar:nth-child(4) {
    animation-delay: 0.3s;
}

.wave-bar:nth-child(5) {
    animation-delay: 0.4s;
}

/* Equalizer Bars */
.equalizer-bar {
    width: 4px;
    background: linear-gradient(to top, #a855f7, #ec4899);
    border-radius: 2px;
    animation: equalizer 0.8s ease-in-out infinite;
}

.equalizer-bar:nth-child(1) {
    animation-delay: 0s;
}

.equalizer-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.equalizer-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.equalizer-bar:nth-child(4) {
    animation-delay: 0.3s;
}

.equalizer-bar:nth-child(5) {
    animation-delay: 0.4s;
}

/* Feature Cards */
.feature-card {
    transition: all 0.3s ease;
    transform: translateY(0);
}

.feature-card:hover {
    transform: translateY(-10px);
}

/* Scroll Reveal */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.feature-tab {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    color: #9ca3af;
    cursor: pointer;
}

.feature-tab.active {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    color: white;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

.feature-tab:hover:not(.active) {
    background: rgba(139, 92, 246, 0.2);
    border-color: #8b5cf6;
}


/* Genre Folder */
.genre-folder {
    transition: all 0.3s ease;
}

.genre-folder:hover {
    transform: translateX(5px);
    background: rgba(139, 92, 246, 0.1);
}

/* Fade in animation */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fade-in 0.3s ease-out;
}

/* Upload Area */
#uploadArea {
    transition: all 0.3s ease;
}

#uploadArea.dragover {
    background: rgba(139, 92, 246, 0.2);
    border-color: #8b5cf6;
    transform: scale(1.02);
}

/* Audio Player */
.audio-player {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
}

/* Progress Bar */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #a855f7;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #a855f7;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

/* Vinyl Record */
.vinyl-record {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(45deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.vinyl-record::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #8b5cf6;
}

.vinyl-record.playing {
    animation: spin 3s linear infinite;
}

@media (max-width: 768px) {
    .smoke-orb {
        filter: blur(80px);
    }

    .smoke-orb-1,
    .smoke-orb-2 {
        width: 500px;
        height: 500px;
    }

    .smoke-orb-3,
    .smoke-orb-4 {
        width: 400px;
        height: 400px;
    }
}

canvas {
    display: block;
    width: 100% !important;
    height: auto !important;
    max-height: 300px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.chart-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.chart-container canvas {
    display: block;
    width: 100%;
}

.visualization-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #2a3f54 0%, #3a4f64 100%) !important;
}

.visualization-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.visualization-card::before {
    left: 100%;
}

.visualization-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3) !important;
}

/* Ensure container max-width utilizes more space */
#resultsSection .container,
#comparison-section .container {
    max-width: none !important;
    padding-left: 2rem;
    padding-right: 2rem;
}

@media (min-width: 1024px) {

    #resultsSection .container,
    #comparison-section .container {
        padding-left: 4rem;
        padding-right: 4rem;
    }
}

/* Ensure container max-width utilizes more space */
#resultsSection .container,
#comparison-section .container {
    max-width: none !important;
    padding-left: 2rem;
    padding-right: 2rem;
}

@media (min-width: 1024px) {

    #resultsSection .container,
    #comparison-section .container {
        padding-left: 4rem;
        padding-right: 4rem;
    }
}

.viz-mode-btn.active {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%) !important;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}

.error-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    transition: all 0.3s ease;
}

.processing-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #8b5cf6;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

canvas {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}