/* ===========================================
   ANIMATIONS - Christmas Playlist
   =========================================== */

/* ===== PARTICULES ===== */
#particles-container {
    position: fixed;
    inset: 0;
    z-index: var(--z-particles);
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--color-gold);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 15s infinite;
    box-shadow: 0 0 10px var(--color-gold), 0 0 20px var(--color-gold-dark);
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) scale(1);
    }
}

/* Variation des particules */
.particle:nth-child(even) {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.particle:nth-child(3n) {
    width: 6px;
    height: 6px;
}

.particle:nth-child(5n) {
    width: 3px;
    height: 3px;
}

/* ===== FLOCONS DE NEIGE ===== */
.snowflake {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    animation: snowfall linear infinite;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

@keyframes snowfall {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0) rotate(0deg);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) translateX(50px) rotate(360deg);
    }
}

/* Variations des flocons pour un effet plus naturel */
.snowflake:nth-child(odd) {
    animation-name: snowfallAlt;
}

@keyframes snowfallAlt {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0) rotate(0deg);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) translateX(-50px) rotate(-360deg);
    }
}

.snowflake:nth-child(3n) {
    animation-timing-function: ease-in-out;
}

.snowflake:nth-child(5n) {
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.9), 0 0 15px rgba(200, 220, 255, 0.5);
}

/* ===== GLOW EFFECTS ===== */
.glow-gold {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.glow-gold-strong {
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
}

/* ===== HOVER ANIMATIONS ===== */
.hover-lift {
    transition: transform var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

/* ===== PULSE ===== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ===== SHIMMER ===== */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        var(--glass-bg) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        var(--glass-bg) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* ===== FADE ANIMATIONS ===== */
.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

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

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ===== PLAYING ANIMATION ===== */
@keyframes playing {
    0%, 100% {
        transform: scaleY(0.5);
    }
    50% {
        transform: scaleY(1);
    }
}

.playing-indicator {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 20px;
}

.playing-indicator span {
    width: 3px;
    height: 100%;
    background: var(--color-gold);
    animation: playing 0.5s ease infinite;
}

.playing-indicator span:nth-child(2) {
    animation-delay: 0.1s;
}

.playing-indicator span:nth-child(3) {
    animation-delay: 0.2s;
}

.playing-indicator span:nth-child(4) {
    animation-delay: 0.3s;
}

/* ===== COUNTDOWN ANIMATION ===== */
@keyframes countdownPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.countdown-number {
    display: inline-block;
    animation: countdownPulse 2s ease-in-out infinite;
    color: var(--color-gold);
    font-weight: 700;
}

/* ===== GUIRLANDES LUMINEUSES ===== */
.christmas-lights {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    z-index: calc(var(--z-header) - 1);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    pointer-events: none;
    overflow: hidden;
}

.lights-string {
    display: flex;
    gap: 30px;
    padding: 0 20px;
}

.light-bulb {
    width: 12px;
    height: 18px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: relative;
    animation: twinkle 1.5s ease-in-out infinite;
}

.light-bulb::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #333;
    border-radius: 2px;
}

.light-bulb::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    width: 2px;
    height: 8px;
    background: linear-gradient(to bottom, #2a5a2a, #333);
    transform: translateX(-50%);
}

/* Couleurs des ampoules */
.light-bulb.red {
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #c41e3a);
    box-shadow: 0 0 15px #ff6b6b, 0 0 30px rgba(196, 30, 58, 0.5);
}

.light-bulb.green {
    background: radial-gradient(circle at 30% 30%, #69db7c, #228b22);
    box-shadow: 0 0 15px #69db7c, 0 0 30px rgba(34, 139, 34, 0.5);
}

.light-bulb.gold {
    background: radial-gradient(circle at 30% 30%, #ffd93d, #d4af37);
    box-shadow: 0 0 15px #ffd93d, 0 0 30px rgba(212, 175, 55, 0.5);
}

.light-bulb.blue {
    background: radial-gradient(circle at 30% 30%, #74c0fc, #4a90d9);
    box-shadow: 0 0 15px #74c0fc, 0 0 30px rgba(74, 144, 217, 0.5);
}

.light-bulb.white {
    background: radial-gradient(circle at 30% 30%, #ffffff, #e0e0e0);
    box-shadow: 0 0 15px #ffffff, 0 0 30px rgba(255, 255, 255, 0.5);
}

/* Animation de scintillement */
@keyframes twinkle {
    0%, 100% {
        opacity: 1;
        filter: brightness(1);
    }
    50% {
        opacity: 0.6;
        filter: brightness(0.7);
    }
}

/* Délais pour effet de vague */
.light-bulb:nth-child(1) { animation-delay: 0s; }
.light-bulb:nth-child(2) { animation-delay: 0.2s; }
.light-bulb:nth-child(3) { animation-delay: 0.4s; }
.light-bulb:nth-child(4) { animation-delay: 0.6s; }
.light-bulb:nth-child(5) { animation-delay: 0.8s; }
.light-bulb:nth-child(6) { animation-delay: 1s; }
.light-bulb:nth-child(7) { animation-delay: 0.1s; }
.light-bulb:nth-child(8) { animation-delay: 0.3s; }
.light-bulb:nth-child(9) { animation-delay: 0.5s; }
.light-bulb:nth-child(10) { animation-delay: 0.7s; }
.light-bulb:nth-child(11) { animation-delay: 0.9s; }
.light-bulb:nth-child(12) { animation-delay: 0.15s; }
.light-bulb:nth-child(13) { animation-delay: 0.35s; }
.light-bulb:nth-child(14) { animation-delay: 0.55s; }
.light-bulb:nth-child(15) { animation-delay: 0.75s; }

/* Fil de la guirlande */
.christmas-lights::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        #2a5a2a 5%,
        #2a5a2a 95%,
        transparent 100%
    );
    z-index: -1;
}

/* Ajustement du body pour les guirlandes */
body:has(.christmas-lights) .app-header {
    margin-top: 35px;
}

body:has(.christmas-lights) .login-page {
    padding-top: 50px;
}
