/**
 * PONTE IA - Animações Avançadas de Botões
 * Design moderno com feedback visual profissional
 */

/* ========================================
   1. ANIMAÇÕES DE ENTRADA
   ======================================== */

/* Pulse suave contínuo nos botões principais */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(153, 244, 67, 0.3);
    }
    50% {
        box-shadow: 0 4px 30px rgba(153, 244, 67, 0.5);
    }
}

@keyframes pulse-glow-pink {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(236, 68, 155, 0.3);
    }
    50% {
        box-shadow: 0 4px 30px rgba(236, 68, 155, 0.5);
    }
}

/* Animação de entrada dos botões */
@keyframes button-slide-in {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   2. MELHORIAS VISUAIS DOS BOTÕES
   ======================================== */

/* Todos os botões com animação de entrada */
.btn {
    animation: button-slide-in 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    position: relative;
    overflow: visible;
}

/* Delay progressivo para múltiplos botões */
.btn:nth-child(1) {
    animation-delay: 0s;
}

.btn:nth-child(2) {
    animation-delay: 0.1s;
}

.btn:nth-child(3) {
    animation-delay: 0.2s;
}

/* ========================================
   3. BOTÃO PRIMARY (VERDE) - MELHORADO
   ======================================== */

.btn-primary {
    background: linear-gradient(135deg, #99F443 0%, #7ACC00 100%);
    box-shadow: 
        0 4px 15px rgba(153, 244, 67, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(153, 244, 67, 0.3);
    position: relative;
    overflow: hidden;
    animation: pulse-glow 3s ease-in-out infinite;
}

/* Brilho animado interno */
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.6s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Hover melhorado */
.btn-primary:hover {
    background: linear-gradient(135deg, #AAFF55 0%, #8BDD11 100%);
    box-shadow: 
        0 8px 35px rgba(153, 244, 67, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-4px) scale(1.02);
    border: 1px solid rgba(153, 244, 67, 0.5);
}

/* Active state melhorado */
.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 
        0 2px 10px rgba(153, 244, 67, 0.4),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Loading spinner para botões primary */
.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    right: 15px;
    margin-top: -9px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-top-color: #000000;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ========================================
   4. BOTÃO SECONDARY (ROSA) - MELHORADO
   ======================================== */

.btn-secondary {
    background: linear-gradient(135deg, #EC449B 0%, #D91B7C 100%);
    box-shadow: 
        0 4px 15px rgba(236, 68, 155, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(236, 68, 155, 0.3);
    position: relative;
    overflow: hidden;
    animation: pulse-glow-pink 3s ease-in-out infinite;
}

/* Brilho animado interno */
.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.6s ease;
}

.btn-secondary:hover::before {
    left: 100%;
}

/* Hover melhorado */
.btn-secondary:hover {
    background: linear-gradient(135deg, #FF5AAB 0%, #EA2C8D 100%);
    box-shadow: 
        0 8px 35px rgba(236, 68, 155, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-4px) scale(1.02);
    border: 1px solid rgba(236, 68, 155, 0.5);
}

/* Active state melhorado */
.btn-secondary:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 
        0 2px 10px rgba(236, 68, 155, 0.4),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ========================================
   5. BOTÃO OUTLINE (TRANSPARENTE)
   ======================================== */

.btn-outline,
.btn-outline-pink {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(153, 244, 67, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-outline-pink {
    border: 2px solid rgba(236, 68, 155, 0.4);
}

/* Preenchimento animado ao hover */
.btn-outline::before,
.btn-outline-pink::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: rgba(153, 244, 67, 0.2);
    transition: width 0.4s ease;
    z-index: -1;
}

.btn-outline-pink::before {
    background: rgba(236, 68, 155, 0.2);
}

.btn-outline:hover::before,
.btn-outline-pink:hover::before {
    width: 100%;
}

.btn-outline:hover,
.btn-outline-pink:hover {
    border-color: rgba(153, 244, 67, 0.8);
    box-shadow: 0 8px 30px rgba(153, 244, 67, 0.3);
    transform: translateY(-3px);
}

.btn-outline-pink:hover {
    border-color: rgba(236, 68, 155, 0.8);
    box-shadow: 0 8px 30px rgba(236, 68, 155, 0.3);
}

/* ========================================
   6. BOTÃO DE TEXTO (LINK STYLE)
   ======================================== */

.btn-text {
    background: transparent;
    padding: 0.5rem 1rem;
    position: relative;
    overflow: visible;
}

/* Linha animada embaixo */
.btn-text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s ease;
}

.btn-text:hover::after {
    width: 100%;
}

/* Seta animada */
.btn-text i {
    transition: transform 0.3s ease;
    display: inline-block;
}

.btn-text:hover i {
    transform: translateX(5px);
}

/* ========================================
   7. EFEITOS ESPECIAIS
   ======================================== */

/* Partículas ao clicar */
@keyframes particle-explosion {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* Onda circular ao clicar */
@keyframes ripple-wave {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Glow pulsante */
@keyframes glow-pulse {
    0%, 100% {
        filter: drop-shadow(0 0 5px currentColor);
    }
    50% {
        filter: drop-shadow(0 0 15px currentColor);
    }
}

/* Shake ao erro */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* ========================================
   8. ESTADOS ESPECIAIS
   ======================================== */

/* Botão desabilitado */
.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    animation: none;
    box-shadow: none;
}

/* Botão carregando */
.btn.loading {
    pointer-events: none;
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Botão com sucesso */
.btn.success {
    background: linear-gradient(135deg, #00C853 0%, #00A845 100%);
    animation: success-bounce 0.6s ease;
}

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

/* Botão com erro */
.btn.error {
    background: linear-gradient(135deg, #F44336 0%, #D32F2F 100%);
    animation: shake 0.5s ease;
}

/* ========================================
   9. ÍCONES ANIMADOS
   ======================================== */

/* Ícones dentro dos botões */
.btn i,
.btn svg {
    transition: all 0.3s ease;
    display: inline-block;
}

/* Rotação ao hover */
.btn-primary:hover i,
.btn-secondary:hover i {
    transform: rotate(360deg);
}

/* Escala ao hover */
.btn-outline:hover i,
.btn-outline-pink:hover i {
    transform: scale(1.2);
}

/* Bounce ao hover */
.btn:hover i {
    animation: icon-bounce 0.6s ease;
}

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

/* ========================================
   10. GRUPOS DE BOTÕES
   ======================================== */

/* Container de botões */
.card-ctas,
.hero-ctas,
.cta-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Animação em cascata */
.card-ctas .btn:nth-child(1) {
    animation-delay: 0s;
}

.card-ctas .btn:nth-child(2) {
    animation-delay: 0.1s;
}

.card-ctas .btn:nth-child(3) {
    animation-delay: 0.2s;
}

/* ========================================
   11. RESPONSIVIDADE
   ======================================== */

@media (max-width: 768px) {
    /* Botões maiores para touch */
    .btn {
        min-height: 48px;
        padding: 0.875rem 1.75rem;
        font-size: 1rem;
    }

    /* Reduzir animações em mobile */
    .btn {
        animation-duration: 0.4s;
    }

    /* Desabilitar pulse contínuo em mobile */
    .btn-primary,
    .btn-secondary {
        animation: none;
    }

    /* Hover simplificado */
    .btn:hover {
        transform: translateY(-2px);
    }

    /* Grupos de botões empilhados */
    .card-ctas,
    .hero-ctas,
    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }

    .card-ctas .btn,
    .hero-ctas .btn,
    .cta-buttons .btn {
        width: 100%;
    }
}

/* ========================================
   12. TEMA ESCURO INTENSIFICADO
   ======================================== */

/* Contraste aumentado para tema escuro */
body {
    --btn-contrast: 1.2;
}

.btn-primary {
    filter: contrast(var(--btn-contrast));
}

.btn-secondary {
    filter: contrast(var(--btn-contrast));
}

/* ========================================
   13. ACESSIBILIDADE
   ======================================== */

/* Focus melhorado */
.btn:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 4px;
    box-shadow: 0 0 0 4px rgba(153, 244, 67, 0.2);
}

.btn-secondary:focus-visible {
    outline-color: var(--color-pink);
    box-shadow: 0 0 0 4px rgba(236, 68, 155, 0.2);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .btn,
    .btn::before,
    .btn::after,
    .btn i {
        animation: none !important;
        transition: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .btn {
        border-width: 3px;
        font-weight: 700;
    }

    .btn-primary {
        background: #CCFF00;
        color: #000000;
    }

    .btn-secondary {
        background: #FF0099;
        color: #FFFFFF;
    }
}

/* ========================================
   14. MICRO-INTERAÇÕES
   ======================================== */

/* Cursor mais interativo */
.btn {
    cursor: pointer;
}

.btn:hover {
    cursor: pointer;
}

.btn:active {
    cursor: pointer;
}

/* Feedback tátil visual */
.btn:active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: inherit;
    transform: translate(-50%, -50%) scale(0);
    animation: tap-feedback 0.4s ease;
}

@keyframes tap-feedback {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* ========================================
   15. PERFORMANCE
   ======================================== */

/* GPU acceleration */
.btn {
    will-change: transform, box-shadow;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Smooth animations */
.btn,
.btn::before,
.btn::after {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
