/* ==========================================================================
   animations.css — Card Vacinas v7.20.0 (Teal Current)
   Sistema centralizado de animações e micro-interações.
   ========================================================================== */

/* ==========================================================================
   1. SHIELD ICON — Nós pulsando em cascata (icone_victory.svg)
   ========================================================================== */

@keyframes nodePulse {
    0%, 100% { opacity: 0.3; r: 3; }
    50% { opacity: 1; r: 4.5; }
}

@keyframes nodeCore {
    0%, 100% { opacity: 1; r: 5; }
    50% { opacity: 0.7; r: 6.5; }
}

/* Inline SVG pulse (navbar header) */
@keyframes corePulse {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 0.5; }
}

@keyframes ringPulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.05; }
}

@keyframes rayPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

@keyframes linkTransmit {
    0% { stroke-opacity: 0.15; }
    50% { stroke-opacity: 0.7; }
    100% { stroke-opacity: 0.15; }
}

/* Aplicado via classes no SVG — delays escalonados em cascata */
.node-1  { animation: nodePulse 3s ease-in-out 0.0s infinite; transform-origin: center; }
.node-2  { animation: nodePulse 3s ease-in-out 0.3s infinite; transform-origin: center; }
.node-3  { animation: nodePulse 3s ease-in-out 0.6s infinite; transform-origin: center; }
.node-4  { animation: nodePulse 3s ease-in-out 0.9s infinite; transform-origin: center; }
.node-5  { animation: nodePulse 3s ease-in-out 1.2s infinite; transform-origin: center; }
.node-6  { animation: nodePulse 3s ease-in-out 1.5s infinite; transform-origin: center; }
.node-7  { animation: nodePulse 3s ease-in-out 1.8s infinite; transform-origin: center; }
.node-8  { animation: nodePulse 3s ease-in-out 2.1s infinite; transform-origin: center; }
.node-core { animation: nodeCore 4s ease-in-out infinite; }

.link { animation: linkTransmit 4s ease-in-out infinite; }
.link-1 { animation-delay: 0.0s; }
.link-2 { animation-delay: 0.8s; }
.link-3 { animation-delay: 1.6s; }
.link-4 { animation-delay: 2.4s; }

/* ==========================================================================
   2. HERO — Mesh gradient animado
   ========================================================================== */

@keyframes meshShift {
    0%   { background-position: 0% 50%; }
    25%  { background-position: 100% 0%; }
    50%  { background-position: 100% 50%; }
    75%  { background-position: 0% 100%; }
    100% { background-position: 0% 50%; }
}

.hero-mesh {
    background: linear-gradient(
        135deg,
        var(--blue-600) 0%,
        var(--teal-500) 30%,
        var(--blue-400) 60%,
        var(--teal-600) 100%
    );
    background-size: 200% 200%;
    animation: meshShift 15s ease-in-out infinite;
}

.hero-mesh .hero-title,
.hero-mesh .hero-subtitle,
.hero-mesh .btn {
    position: relative;
    z-index: 1;
}

.hero-mesh::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60"><circle cx="30" cy="30" r="1.5" fill="white" opacity="0.1"/><path d="M30,0 L30,60 M0,30 L60,30" stroke="white" stroke-width="0.5" opacity="0.05"/></svg>');
    pointer-events: none;
    z-index: 0;
}

/* ==========================================================================
   3. PAGE REVEAL — FadeInUp via IntersectionObserver
   ========================================================================== */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ==========================================================================
   4. STATUS BADGE PULSE — Glow teal para badges "Protegido"
   ========================================================================== */

@keyframes statusPulse {
    0%   { box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.4); }
    70%  { box-shadow: 0 0 0 8px rgba(13, 148, 136, 0); }
    100% { box-shadow: 0 0 0 0 rgba(13, 148, 136, 0); }
}

.badge-pulse {
    animation: statusPulse 2s ease-in-out infinite;
}

/* ==========================================================================
   5. LOADING SKELETON — Shimmer placeholder
   ========================================================================== */

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--gray-100) 25%,
        var(--teal-50) 50%,
        var(--gray-100) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--theme-border-radius);
    color: transparent !important;
    user-select: none;
    pointer-events: none;
}

.skeleton-text {
    display: inline-block;
    height: 1em;
    width: 100%;
    margin-bottom: 0.5rem;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-card {
    height: 120px;
    width: 100%;
}

/* ==========================================================================
   6. CARD TECH GLOW — Hover com glow teal
   ========================================================================== */

.card-tech {
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
}

.card-tech:hover {
    transform: translateY(-3px);
    box-shadow:
        0 0 0 1px var(--accent-tech-border),
        0 4px 12px rgba(13, 148, 136, 0.1),
        var(--elevation-md);
}

.card-tech .stats-icon-wrapper {
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.card-tech:hover .stats-icon-wrapper {
    background-color: var(--accent-tech);
    color: white;
    transform: scale(1.1);
}

/* ==========================================================================
   7. BUTTON GLOW — Hover sutil em botões
   ========================================================================== */

.btn-glow {
    transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
}

.btn-glow:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

/* ==========================================================================
   8. PAGE TRANSITIONS
   ========================================================================== */

@keyframes pageEnter {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.page-enter {
    animation: pageEnter 0.4s ease-out forwards;
}

/* ==========================================================================
   9. COUNTER (refinamento do existente)
   ========================================================================== */

@keyframes countUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.counter-value {
    animation: countUp 0.6s ease-out;
}

/* ==========================================================================
   10. ACCESSIBILITY — prefers-reduced-motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .skeleton {
        background: var(--gray-100);
        animation: none;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .badge-pulse {
        animation: none;
        box-shadow: none;
    }

    .hero-mesh {
        animation: none;
    }

    .node-1, .node-2, .node-3, .node-4,
    .node-5, .node-6, .node-7, .node-8,
    .node-core,
    .link {
        animation: none !important;
    }
}

/* ==========================================================================
   LEGACY — mantidos para compatibilidade (movidos de design-system.css)
   ========================================================================== */

.animate-vs-fade {
    animation: vsFadeInUp 0.6s ease-out forwards;
}

.animate-vs-pulse {
    animation: vsDataPulse 2s infinite;
}

.animate-cv-bounce {
    animation: cvBounceIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.animate-cv-float {
    animation: cvFloat 4s ease-in-out infinite;
}
