/* ===================================
   ANIMAÇÕES DE ENTRADA E SAÍDA
   Plataforma EAD - UI Dinâmica
   =================================== */

/* Keyframes para fade in */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Classes de animação */
.ead-animate {
    animation-fill-mode: both;
}

.ead-fade-in {
    animation: fadeIn 0.5s ease-out;
}

.ead-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.ead-fade-in-down {
    animation: fadeInDown 0.6s ease-out;
}

.ead-fade-in-left {
    animation: fadeInLeft 0.6s ease-out;
}

.ead-fade-in-right {
    animation: fadeInRight 0.6s ease-out;
}

.ead-scale-in {
    animation: scaleIn 0.4s ease-out;
}

.ead-slide-in-up {
    animation: slideInUp 0.5s ease-out;
}

/* Delays para animações em sequência */
.ead-delay-1 { animation-delay: 0.1s; }
.ead-delay-2 { animation-delay: 0.2s; }
.ead-delay-3 { animation-delay: 0.3s; }
.ead-delay-4 { animation-delay: 0.4s; }
.ead-delay-5 { animation-delay: 0.5s; }

/* ===================================
   ANIMAÇÕES PARA COMPONENTES
   =================================== */

/* Cards */
.ead-course-card,
.ead-nivel-card,
.ead-event-card,
.je-level-card,
.ead-ebook-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

/* Sequência de cards */
.ead-course-card:nth-child(1), .je-level-card:nth-child(1) { animation-delay: 0.05s; }
.ead-course-card:nth-child(2), .je-level-card:nth-child(2) { animation-delay: 0.1s; }
.ead-course-card:nth-child(3), .je-level-card:nth-child(3) { animation-delay: 0.15s; }
.ead-course-card:nth-child(4), .je-level-card:nth-child(4) { animation-delay: 0.2s; }
.ead-course-card:nth-child(5), .je-level-card:nth-child(5) { animation-delay: 0.25s; }
.ead-course-card:nth-child(6), .je-level-card:nth-child(6) { animation-delay: 0.3s; }

/* Títulos e seções */
.ead-section-title,
.je-section-title,
.ead-course-main h1,
.ead-event-info h1 {
    animation: fadeInDown 0.5s ease-out;
}

/* Botões CTA */
.ead-cta-btn,
.ead-enroll-btn,
.je-enroll-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ead-cta-btn:hover,
.ead-enroll-btn:hover,
.je-enroll-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(160, 32, 240, 0.4);
}

/* Sidebar e elementos fixos */
.ead-purchase-card,
.ead-event-sidebar {
    animation: fadeInRight 0.6s ease-out;
    animation-delay: 0.2s;
    animation-fill-mode: both;
}

/* Accordions */
.ead-module-accordion {
    animation: fadeInUp 0.4s ease-out;
    animation-fill-mode: both;
}

.ead-module-accordion:nth-child(1) { animation-delay: 0.1s; }
.ead-module-accordion:nth-child(2) { animation-delay: 0.15s; }
.ead-module-accordion:nth-child(3) { animation-delay: 0.2s; }
.ead-module-accordion:nth-child(4) { animation-delay: 0.25s; }
.ead-module-accordion:nth-child(5) { animation-delay: 0.3s; }

/* Badges */
.ead-course-stats .stat-badge,
.ead-event-badges .badge {
    animation: scaleIn 0.4s ease-out;
    animation-fill-mode: both;
}

.ead-course-stats .stat-badge:nth-child(1) { animation-delay: 0.1s; }
.ead-course-stats .stat-badge:nth-child(2) { animation-delay: 0.15s; }
.ead-course-stats .stat-badge:nth-child(3) { animation-delay: 0.2s; }
.ead-course-stats .stat-badge:nth-child(4) { animation-delay: 0.25s; }

/* ===================================
   MICRO-INTERAÇÕES
   =================================== */

/* Hover suave em cards */
.ead-course-card,
.ead-nivel-card,
.je-level-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ead-course-card:hover,
.ead-nivel-card:hover,
.je-level-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Progress bars animadas */
.ead-progress-fill,
.je-progress-fill,
.progress-bar-fill {
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ícones com pulse */
.ead-icon-animate {
    animation: pulse 2s infinite;
}

/* Loading shimmer effect */
.ead-loading-shimmer {
    background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ===================================
   TRANSIÇÕES DE PÁGINA
   =================================== */

/* Container principal com fade */
.ead-page-container,
.ead-dashboard-container,
.ead-course-page,
.ead-event-page,
.je-container {
    animation: fadeIn 0.4s ease-out;
}

/* ===================================
   RESPONSIVIDADE
   =================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
