/**
 * Live Training Ad Dynamic Styles
 * Production Version
 */

/* Enhanced container states */
.ad-hipaa-container.live-ad-urgent {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.ad-hipaa-container.live-ad-very-urgent {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    animation: urgentGlow 2s ease-in-out infinite;
}

@keyframes urgentGlow {
    0%, 100% {
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    50% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
    }
}

/* Dynamic badge states */
.live-ad-badge-urgent {
    animation: badgePulse 1.5s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: rotate(12deg) scale(1);
        background: linear-gradient(135deg, #ef4444, #dc2626);
    }
    50% {
        transform: rotate(12deg) scale(1.08);
        background: linear-gradient(135deg, #dc2626, #b91c1c);
        box-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
    }
}

.live-ad-badge-very-urgent {
    animation: badgeShake 0.5s ease-in-out infinite;
}

@keyframes badgeShake {
    0%, 100% { transform: rotate(12deg) translateX(0); }
    25% { transform: rotate(12deg) translateX(-2px); }
    75% { transform: rotate(12deg) translateX(2px); }
}

/* Countdown bar */
.live-ad-countdown-bar {
    background: #f3f4f6;
    border-radius: 20px;
    height: 24px;
    position: relative;
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.live-ad-countdown-progress {
    background: linear-gradient(90deg, #10b981, #059669);
    height: 100%;
    border-radius: 20px;
    transition: width 1s linear, background 0.5s ease;
    position: relative;
    overflow: hidden;
}

.live-ad-countdown-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.live-ad-countdown-progress.urgent {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.live-ad-countdown-progress.very-urgent {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.live-ad-countdown-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    z-index: 1;
    white-space: nowrap;
}

/* Scarcity message animations */
.live-ad-scarcity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: linear-gradient(135deg, #fef3c7, #fed7aa);
    border-radius: 6px;
    border: 1px solid #fbbf24;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.live-ad-urgent .live-ad-scarcity {
    background: linear-gradient(135deg, #fed7aa, #fdba74);
    border-color: #f97316;
}

.live-ad-very-urgent .live-ad-scarcity {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-color: #f87171;
}

.live-ad-scarcity-icon {
    font-size: 1rem;
    animation: iconFlame 1s ease-in-out infinite;
}

@keyframes iconFlame {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
}

/* Activity indicator */
.live-ad-activity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 6px;
    font-size: 0.75rem;
    color: #0369a1;
    border: 1px solid #7dd3fc;
    transition: all 0.3s ease;
}

.live-ad-activity-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: activityPulse 1.5s ease-in-out infinite;
}

@keyframes activityPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Flash animation for number updates */
.live-ad-flash {
    animation: numberFlash 0.6s ease-out;
}

@keyframes numberFlash {
    0% {
        background: rgba(37, 99, 235, 0.2);
        transform: scale(1);
    }
    50% {
        background: rgba(37, 99, 235, 0.1);
        transform: scale(1.1);
    }
    100% {
        background: transparent;
        transform: scale(1);
    }
}

/* CTA button enhancements */
.live-ad-urgent .ad-cta {
    animation: ctaUrgentPulse 1.5s ease-in-out infinite;
}

.live-ad-very-urgent .ad-cta {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    animation: ctaVeryUrgentPulse 1s ease-in-out infinite;
}

@keyframes ctaUrgentPulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(245, 158, 11, 0.5);
    }
}

@keyframes ctaVeryUrgentPulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.6);
        transform: scale(1.02);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .live-ad-countdown-bar {
        height: 22px;
    }
    
    .live-ad-countdown-text {
        font-size: 0.7rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
    
    .live-ad-countdown-progress::after {
        display: none;
    }
}