/**
 * TRAZZAR - Animaciones CSS
 * Efectos de entrada y micro-interacciones
 */

/* ============================================
   REVEAL ANIMATIONS (Scroll)
   ============================================ */
.reveal-hidden {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-hidden.reveal {
    opacity: 1;
    transform: translateY(0);
}

/* Diferentes delays para un efecto escalonado */
.result-card:nth-child(1) { transition-delay: 0.05s; }
.result-card:nth-child(2) { transition-delay: 0.15s; }
.result-card:nth-child(3) { transition-delay: 0.25s; }

.capability-card:nth-child(1) { transition-delay: 0.05s; }
.capability-card:nth-child(2) { transition-delay: 0.10s; }
.capability-card:nth-child(3) { transition-delay: 0.15s; }
.capability-card:nth-child(4) { transition-delay: 0.20s; }
.capability-card:nth-child(5) { transition-delay: 0.25s; }

.step:nth-child(1) { transition-delay: 0.05s; }
.step:nth-child(2) { transition-delay: 0.15s; }
.step:nth-child(3) { transition-delay: 0.25s; }

.type-item:nth-child(1) { transition-delay: 0.05s; }
.type-item:nth-child(2) { transition-delay: 0.15s; }
.type-item:nth-child(3) { transition-delay: 0.25s; }

.sector-card:nth-child(1) { transition-delay: 0.05s; }
.sector-card:nth-child(2) { transition-delay: 0.15s; }
.sector-card:nth-child(3) { transition-delay: 0.25s; }

.metric:nth-child(1) { transition-delay: 0.05s; }
.metric:nth-child(2) { transition-delay: 0.10s; }
.metric:nth-child(3) { transition-delay: 0.15s; }
.metric:nth-child(4) { transition-delay: 0.20s; }

.team-card:nth-child(1) { transition-delay: 0.05s; }
.team-card:nth-child(2) { transition-delay: 0.15s; }
.team-card:nth-child(3) { transition-delay: 0.25s; }

/* ============================================
   FLOATING CARDS (Hero)
   ============================================ */
.floating-card {
    animation: float 6s ease-in-out infinite;
}

.floating-card.card-1 {
    animation-delay: 0s;
}

.floating-card.card-2 {
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

/* ============================================
   PULSE (para badges y elementos destacados)
   ============================================ */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

.hero-badge {
    animation: pulse 3s ease-in-out infinite;
}

/* ============================================
   GLOW (para elementos con hover)
   ============================================ */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(230, 168, 23, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(230, 168, 23, 0.4);
    }
}

.btn-primary {
    animation: glow 3s ease-in-out infinite;
}

.btn-primary:hover {
    animation: none;
}

/* ============================================
   FADE IN (para carga inicial)
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content {
    animation: fadeInUp 1s ease-out forwards;
}

.hero-visual {
    animation: fadeInUp 1s ease-out 0.3s forwards;
    opacity: 0;
}

/* ============================================
   HOVER EFFECTS
   ============================================ */
/* Efecto de elevación en tarjetas */
.card-hover {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

/* Efecto de línea subrayado en enlaces */
.underline-hover {
    position: relative;
    display: inline-block;
}

.underline-hover::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width 0.3s ease;
}

.underline-hover:hover::after {
    width: 100%;
}

/* ============================================
   PRELOADER (opcional)
   ============================================ */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(230, 168, 23, 0.15);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}