/**
 * Styles pour le système d'urgence
 * Animations et effets visuels pour créer la sensation de rareté
 */

/* Animation de pulsation pour les badges critiques */
@keyframes urgency-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.3), 0 4px 6px -2px rgba(239, 68, 68, 0.2);
    }
}

/* Animation de brillance */
@keyframes urgency-shine {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* Animation de flamme pour les badges critiques */
@keyframes flame-flicker {
    0%, 100% {
        text-shadow: 0 0 5px rgba(239, 68, 68, 0.8),
                     0 0 10px rgba(239, 68, 68, 0.6),
                     0 0 15px rgba(239, 68, 68, 0.4);
    }
    50% {
        text-shadow: 0 0 10px rgba(239, 68, 68, 1),
                     0 0 20px rgba(239, 68, 68, 0.8),
                     0 0 30px rgba(239, 68, 68, 0.6);
    }
}

/* Badge d'urgence critique */
.urgency-critical {
    animation: urgency-pulse 2s ease-in-out infinite;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    position: relative;
    overflow: hidden;
}

.urgency-critical::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: urgency-shine 3s infinite;
}

.urgency-critical .fa-fire {
    animation: flame-flicker 1.5s ease-in-out infinite;
}

/* Badge d'urgence très haute */
.urgency-very-high {
    background: linear-gradient(135deg, #f97316, #ea580c);
    animation: urgency-pulse 3s ease-in-out infinite;
}

/* Badge d'urgence haute */
.urgency-high {
    background: linear-gradient(135deg, #eab308, #ca8a04);
}

/* Indicateur de stock bas */
.stock-indicator {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.stock-indicator.critical::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, #ef4444, #f97316);
    border-radius: 9999px;
    opacity: 0.3;
    animation: urgency-pulse 2s ease-in-out infinite;
    z-index: -1;
}

/* Compte à rebours animé */
.countdown-urgent {
    position: relative;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(249, 115, 22, 0.1));
    border: 2px solid;
    border-image: linear-gradient(135deg, #ef4444, #f97316) 1;
}

.countdown-urgent::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    border-radius: inherit;
    opacity: 0.1;
    animation: urgency-pulse 3s ease-in-out infinite;
    z-index: -1;
}

/* Animation de bordure pour les sections critiques */
@keyframes border-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(239, 68, 68, 0.5),
                    0 0 10px rgba(239, 68, 68, 0.3),
                    inset 0 0 5px rgba(239, 68, 68, 0.1);
    }
    50% {
        box-shadow: 0 0 10px rgba(239, 68, 68, 0.8),
                    0 0 20px rgba(239, 68, 68, 0.5),
                    inset 0 0 10px rgba(239, 68, 68, 0.2);
    }
}

.urgency-border-glow {
    animation: border-glow 2s ease-in-out infinite;
}

/* Animation de texte clignotant subtil */
@keyframes text-blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.urgency-text-blink {
    animation: text-blink 2s ease-in-out infinite;
}

/* Effet de progression pour les barres de stock */
@keyframes stock-bar-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.stock-bar {
    position: relative;
    height: 8px;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}

.stock-bar-fill {
    height: 100%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 9999px;
}

.stock-bar-fill.critical {
    background: linear-gradient(90deg, #ef4444, #dc2626);
    animation: stock-bar-pulse 2s ease-in-out infinite;
}

.stock-bar-fill.high {
    background: linear-gradient(90deg, #f97316, #ea580c);
}

.stock-bar-fill.medium {
    background: linear-gradient(90deg, #eab308, #ca8a04);
}

.stock-bar-fill.low {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

/* Animation pour les chiffres qui défilent */
@keyframes number-roll {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    50% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-100%);
        opacity: 0;
    }
}

.number-roller {
    display: inline-block;
    position: relative;
    overflow: hidden;
    height: 1.5em;
    line-height: 1.5em;
}

.number-roller span {
    display: block;
    animation: number-roll 3s ease-in-out infinite;
}

/* Effet de spotlight pour attirer l'attention */
@keyframes spotlight {
    0% {
        background-position: -100% center;
    }
    100% {
        background-position: 200% center;
    }
}

.urgency-spotlight {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 45%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.1) 55%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: spotlight 3s linear infinite;
}

/* Mobile: adaptations spécifiques */
@media (max-width: 768px) {
    .urgency-critical,
    .urgency-very-high {
        animation-duration: 3s; /* Ralentir sur mobile pour économiser la batterie */
    }
    
    .urgency-critical::before {
        animation: none; /* Désactiver l'effet de brillance sur mobile */
    }
}

/* Effet de vibration subtile pour mobile */
@media (max-width: 768px) and (hover: none) {
    .urgency-critical {
        animation: mobile-vibrate 0.3s ease-in-out;
        animation-iteration-count: 3;
    }
    
    @keyframes mobile-vibrate {
        0%, 100% {
            transform: translateX(0);
        }
        25% {
            transform: translateX(-2px);
        }
        75% {
            transform: translateX(2px);
        }
    }
}

/* Badge "Derniers billets" flottant */
.last-tickets-float {
    position: fixed;
    bottom: 100px;
    right: 20px;
    z-index: 1000;
    animation: float-bob 3s ease-in-out infinite;
}

@keyframes float-bob {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Effet de compte pour les nombres */
.count-up {
    display: inline-block;
    animation: count-scale 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes count-scale {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}