/* Elite Dental - Animações Premium */
/* ============================================ */

/* ============================================
   ANIMAÇÕES DE ENTRADA (Page Load)
   ============================================ */

/* Fade In básico */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide In das direções */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

/* Scale com Fade */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleInBounce {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Blur Reveal */
@keyframes blurReveal {
    from {
        opacity: 0;
        filter: blur(20px);
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

/* ============================================
   ANIMAÇÕES DE HOVER
   ============================================ */

/* Pulse suave */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
}

/* Bounce */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
        transform: translateY(0);
    }
    40%, 43% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translateY(-15px);
    }
    70% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translateY(-8px);
    }
    90% {
        transform: translateY(-3px);
    }
}

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

/* Wiggle para atenção */
@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    15% {
        transform: rotate(-5deg);
    }
    30% {
        transform: rotate(4deg);
    }
    45% {
        transform: rotate(-4deg);
    }
    60% {
        transform: rotate(3deg);
    }
    75% {
        transform: rotate(-2deg);
    }
}

/* ============================================
   ANIMAÇÕES DE ELEMENTOS FLUTUANTES
   ============================================ */

/* Float suave */
@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-12px) rotate(2deg);
    }
    50% {
        transform: translateY(-5px) rotate(-1deg);
    }
    75% {
        transform: translateY(-15px) rotate(1deg);
    }
}

/* Orbit - movimento circular */
@keyframes orbit {
    from {
        transform: rotate(0deg) translateX(20px) rotate(0deg);
    }
    to {
        transform: rotate(360deg) translateX(20px) rotate(-360deg);
    }
}

/* ============================================
   ANIMAÇÕES DE BRILHO E GLOW
   ============================================ */

/* Glow pulsante */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(212, 175, 55, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(212, 175, 55, 0.6), 0 0 40px rgba(212, 175, 55, 0.3);
    }
}

/* Shimmer - efeito de brilho passando */
@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* Gradient Shift */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ============================================
   ANIMAÇÕES DO WHATSAPP
   ============================================ */

/* Pulse Ring */
@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* WhatsApp Attention */
@keyframes whatsappAttention {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 6px 25px rgba(37, 211, 102, 0.4);
    }
    25% {
        transform: scale(1.08);
        box-shadow: 0 8px 30px rgba(37, 211, 102, 0.5);
    }
    50% {
        transform: scale(1);
        box-shadow: 0 6px 25px rgba(37, 211, 102, 0.4);
    }
    75% {
        transform: scale(1.05);
        box-shadow: 0 7px 28px rgba(37, 211, 102, 0.45);
    }
}

/* ============================================
   ANIMAÇÕES DE LOADING
   ============================================ */

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

/* Dots loading */
@keyframes dotsLoading {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Progress bar */
@keyframes progressBar {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* ============================================
   ANIMAÇÕES DE TEXTO
   ============================================ */

/* Typewriter */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Blink cursor */
@keyframes blinkCursor {
    0%, 50% {
        border-color: transparent;
    }
    51%, 100% {
        border-color: currentColor;
    }
}

/* Text reveal */
@keyframes textReveal {
    0% {
        clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    }
    100% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

/* ============================================
   CLASSES UTILITÁRIAS DE ANIMAÇÃO
   ============================================ */

/* Fade */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out both;
}

.animate-fade-in-delay-1 {
    animation: fadeIn 0.6s ease-out 0.1s both;
}

.animate-fade-in-delay-2 {
    animation: fadeIn 0.6s ease-out 0.2s both;
}

.animate-fade-in-delay-3 {
    animation: fadeIn 0.6s ease-out 0.3s both;
}

/* Slide */
.animate-slide-up {
    animation: slideInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.animate-slide-down {
    animation: slideInDown 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.animate-slide-left {
    animation: slideInLeft 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.animate-slide-right {
    animation: slideInRight 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Scale */
.animate-scale-in {
    animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.animate-scale-bounce {
    animation: scaleInBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

/* Blur Reveal */
.animate-blur-reveal {
    animation: blurReveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ============================================
   ANIMAÇÕES DE SCROLL (Intersection Observer)
   ============================================ */

.reveal-on-scroll {
    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-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-scale-on-scroll {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.6s ease-out,
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale-on-scroll.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Stagger animations para listas */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.stagger-item.revealed {
    opacity: 1;
    transform: translateY(0);
}

.stagger-item:nth-child(1) { transition-delay: 0.05s; }
.stagger-item:nth-child(2) { transition-delay: 0.1s; }
.stagger-item:nth-child(3) { transition-delay: 0.15s; }
.stagger-item:nth-child(4) { transition-delay: 0.2s; }
.stagger-item:nth-child(5) { transition-delay: 0.25s; }
.stagger-item:nth-child(6) { transition-delay: 0.3s; }
.stagger-item:nth-child(7) { transition-delay: 0.35s; }
.stagger-item:nth-child(8) { transition-delay: 0.4s; }
.stagger-item:nth-child(9) { transition-delay: 0.45s; }
.stagger-item:nth-child(10) { transition-delay: 0.5s; }

/* ============================================
   EFEITOS INTERATIVOS
   ============================================ */

/* Hover lift */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Hover glow */
.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
}

/* Hover scale */
.hover-scale {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Shimmer effect on hover */
.shimmer-on-hover {
    position: relative;
    overflow: hidden;
}

.shimmer-on-hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s ease-out;
}

.shimmer-on-hover:hover::after {
    left: 150%;
}

/* ============================================
   TRANSIÇÕES SUAVES GLOBAIS
   ============================================ */

/* Links e botões */
a,
button,
.btn {
    transition: color 0.2s ease,
                background-color 0.2s ease,
                border-color 0.2s ease,
                transform 0.2s ease,
                box-shadow 0.2s ease;
}

/* Imagens */
img {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease,
                filter 0.3s ease;
}

/* ============================================
   ANIMAÇÕES PARA SEÇÕES ESPECÍFICAS
   ============================================ */

/* Content Section hover effect */
.content-section {
    transition: transform 0.3s ease;
}

/* Underline decorativo animado */
.content-section h2::after {
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hero floating elements */
.hero .container::before,
.hero .container::after {
    animation: float 20s ease-in-out infinite;
}

/* ============================================
   PERFORMANCE E ACESSIBILIDADE
   ============================================ */

/* Will-change para elementos animados frequentemente */
.whatsapp-float,
.btn,
.hover-lift,
.hover-scale {
    will-change: transform;
}

/* Preferência por movimento reduzido */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .reveal-on-scroll,
    .reveal-scale-on-scroll,
    .stagger-item {
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    .whatsapp-float::before {
        animation: none;
    }
}

/* ============================================
   ANIMAÇÕES DE SUCESSO/ERRO
   ============================================ */

/* Checkmark success */
@keyframes checkSuccess {
    0% {
        transform: scale(0) rotate(45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(45deg);
    }
    100% {
        transform: scale(1) rotate(45deg);
        opacity: 1;
    }
}

.animate-success {
    animation: checkSuccess 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

/* Error shake */
.animate-error {
    animation: shake 0.5s ease-in-out;
}

/* ============================================
   ESTILOS PARA SKELETON LOADING
   ============================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--slate-200) 0%,
        var(--slate-100) 50%,
        var(--slate-200) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
    border-radius: 4px;
}

.skeleton-title {
    height: 2em;
    width: 60%;
    margin-bottom: 1em;
}

.skeleton-circle {
    border-radius: 50%;
}
