/* Animações Suaves */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@keyframes flutuar {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.7;
    }
    25% {
        transform: translate(20px, -30px) rotate(90deg);
        opacity: 1;
    }
    50% {
        transform: translate(-15px, -50px) rotate(180deg);
        opacity: 0.8;
    }
    75% {
        transform: translate(30px, -20px) rotate(270deg);
        opacity: 0.9;
    }
}

@keyframes brilhar {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(99, 102, 241, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.8);
    }
}

/* Aplicação de Animações */

.card {
    /* Animação removida para melhor experiência - cards aparecem instantaneamente */
}

.modal.ativo .modal-content {
    /* Animação removida - modal aparece instantaneamente */
}

.mensagem {
    /* Animação removida - mensagens aparecem instantaneamente */
}

.btn-card:hover {
    animation: pulse 0.5s ease-in-out;
}

.btn-card:active {
    transform: scale(0.95);
}

.opcao-quiz.incorreta {
    animation: shake 0.5s ease-in-out;
}

.opcao-quiz.correta {
    animation: bounce 0.5s ease-in-out;
}

.badge.conquistada {
    animation: glow 2s ease-in-out infinite;
}

/* Transições Suaves */
.card,
.btn-card,
.nav-item,
.modulo-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover Effects */

.btn-cta:hover {
    animation: pulse 0.5s ease-in-out;
}

/* Loading Spinner */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.busca-spinner {
    animation: spin 0.8s linear infinite;
}

.spinner {
    border: 3px solid var(--cor-borda);
    border-top: 3px solid var(--cor-primaria);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

/* Progress Bar Animation */
.barra-progresso-fill {
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Swipe Gesture Feedback */
.card.swiping {
    transition: transform 0.1s ease-out;
}

.card.swipe-left {
    transform: translateX(-100%);
    opacity: 0;
}

.card.swipe-right {
    transform: translateX(100%);
    opacity: 0;
}

/* Micro-interações */
.btn-card:focus-visible {
    outline: 2px solid var(--cor-primaria);
    outline-offset: 2px;
}

.input-busca:focus {
    animation: glow 2s ease-in-out infinite;
}

/* Fade in para páginas - removido para melhor experiência */
.pagina-trilha,
.pagina-perfil,
.pagina-explorar {
    /* Animação removida - páginas aparecem instantaneamente */
}

/* Shimmer Button Animations - Baseado no shadcn/ui */
@keyframes shimmer-slide {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes spin-around {
    0% {
        transform: translateZ(0) rotate(0deg);
    }
    15%, 35% {
        transform: translateZ(0) rotate(90deg);
    }
    65%, 85% {
        transform: translateZ(0) rotate(270deg);
    }
    100% {
        transform: translateZ(0) rotate(360deg);
    }
}

/* Shimmer Button Effect para botão Explicar - Design exato da biblioteca */
.btn-card.explicar {
    position: relative;
    --spread: 90deg;
    --shimmer-color: #ffffff;
    --radius: 100px;
    --speed: 3s;
    --cut: 0.05em;
    --bg: rgba(0, 0, 0, 1);
    
    background: var(--bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    color: white;
    overflow: hidden;
    z-index: 0;
    isolation: isolate;
    transform: translateZ(0);
    transition: transform 0.3s ease-in-out;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Spark container - efeito de brilho rotativo */
.btn-card.explicar .shimmer-spark-container {
    position: absolute;
    z-index: -30;
    filter: blur(2px);
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: visible;
    pointer-events: none;
}

.btn-card.explicar .shimmer-spark {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    border-radius: 0;
    mask: none;
}

.btn-card.explicar .shimmer-spark::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: conic-gradient(
        from calc(270deg - (var(--spread) * 0.5)),
        transparent 0deg,
        var(--shimmer-color) var(--spread),
        transparent var(--spread)
    );
    animation: spin-around 6s infinite linear;
}

/* Shimmer slide effect */
.btn-card.explicar::after {
    content: none;
}

.btn-card.explicar > *:not(.shimmer-highlight):not(.shimmer-backdrop):not(.shimmer-spark-container) {
    position: relative;
    z-index: 2;
}

.btn-card.explicar span {
    white-space: pre-wrap;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.025em;
    color: white;
}

.btn-card.explicar svg {
    position: relative;
    z-index: 2;
    color: white;
}

/* Highlight - exatamente como na biblioteca */
.btn-card.explicar .shimmer-highlight {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 16px;
    box-shadow: inset 0 -8px 10px rgba(255, 255, 255, 0.05);
    transition: box-shadow 0.3s ease-in-out;
    pointer-events: none;
    z-index: 1;
}

/* Backdrop - exatamente como na biblioteca */
.btn-card.explicar .shimmer-backdrop {
    position: absolute;
    z-index: -20;
    background: var(--bg);
    border-radius: var(--radius);
    inset: var(--cut);
    pointer-events: none;
}

.btn-card.explicar:hover {
    background: var(--bg);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px) translateZ(0);
}

.btn-card.explicar:hover .shimmer-spark::before {
    animation: spin-around 4s infinite linear;
}

.btn-card.explicar:hover::after {
    content: none;
}

.btn-card.explicar:hover .shimmer-highlight {
    box-shadow: inset 0 -6px 10px rgba(255, 255, 255, 0.25);
}

.btn-card.explicar:active {
    transform: translateY(1px) translateZ(0);
}

.btn-card.explicar:active .shimmer-highlight {
    box-shadow: inset 0 -10px 10px rgba(255, 255, 255, 0.3);
}


