/* Visual Effects CSS */

/* Sound Wave Ripple Effect */
.sound-wave {
    position: fixed;
    pointer-events: none;
    border-radius: 50%;
    border: 3px solid;
    animation: ripple 1s ease-out forwards;
}

.sound-wave.gather {
    border-color: rgba(126, 231, 135, 0.8);
    box-shadow: 0 0 20px rgba(126, 231, 135, 0.4);
}

.sound-wave.charge {
    border-color: rgba(255, 159, 67, 0.8);
    box-shadow: 0 0 20px rgba(255, 159, 67, 0.4);
}

@keyframes ripple {
    0% {
        width: 20px;
        height: 20px;
        opacity: 1;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

/* Floating Hearts (Pet Effect) */
.floating-heart {
    position: fixed;
    font-size: 24px;
    pointer-events: none;
    animation: floatUp 1.5s ease-out forwards;
    z-index: 150;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translateY(-30px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(0.8);
    }
}

/* Particle Burst (Victory) */
.particle {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    pointer-events: none;
    animation: particleBurst 1.5s ease-out forwards;
}

@keyframes particleBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

/* Glow Effect */
.glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        filter: drop-shadow(0 0 5px currentColor);
    }
    50% {
        filter: drop-shadow(0 0 20px currentColor);
    }
}

/* Screen Flash */
.screen-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    pointer-events: none;
    animation: flash 0.3s ease-out forwards;
    z-index: 500;
}

@keyframes flash {
    0% { opacity: 0.5; }
    100% { opacity: 0; }
}

/* Shake Effect */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 200;
    animation: tooltipFade 0.3s ease;
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(0, 0, 0, 0.8);
}

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

/* Progress Bar */
.progress-bar {
    width: 200px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7ee787, #3d8b40);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Notification */
.notification {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 30px;
    border-radius: 10px;
    border-left: 4px solid #7ee787;
    animation: slideDown 0.5s ease, fadeOut 0.5s ease 2.5s forwards;
    z-index: 250;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
}

/* clofen Emotion Bubble */
.emotion-bubble {
    position: absolute;
    background: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    animation: bubblePop 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.emotion-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

@keyframes bubblePop {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Sound Source Indicator */
.sound-source-indicator {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 2px dashed rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: soundPulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes soundPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Recording Available Indicator */
.record-available {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 107, 107, 0.9);
    border-radius: 20px;
    font-size: 12px;
    animation: bounce 1s ease-in-out infinite;
}

.record-available .key {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
