/* ============================================
   IMPROVEMENTS CSS - ANIMAÇÕES & EFEITOS
   ============================================ */

/* ====================
   1. ANIMAÇÕES GLOBAIS
   ==================== */

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

@keyframes float-simple {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes progress-bar {
    from { width: 0; }
    to { width: var(--progress-width); }
}

/* ====================
   2. TYPING ANIMATION
   ==================== */

.typing {
    position: relative;
}

.typing::after {
    content: '|';
    position: absolute;
    right: -8px;
    color: var(--primary);
    animation: blink 1s infinite;
}

/* ====================
   3. TECH STACK ANIMATIONS
   ==================== */

.floating-tech-stack .tech-item {
    animation: float-simple 6s ease-in-out infinite;
}

.tech-item:nth-child(1) { animation-delay: 0s; }
.tech-item:nth-child(2) { animation-delay: 1s; }
.tech-item:nth-child(3) { animation-delay: 2s; }
.tech-item:nth-child(4) { animation-delay: 3s; }

/* Ícones coloridos */
.tech-item .fa-react { color: #61dafb; }
.tech-item .fa-vuejs { color: #42b883; }
.tech-item .fa-node-js { color: #68a063; }
.tech-item .fa-js { color: #f7df1e; }
.tech-item .fa-html5 { color: #e34f26; }
.tech-item .fa-css3-alt { color: #1572b6; }
.tech-item .fa-php { color: #777bb4; }
.tech-item .fa-database { color: #00758f; }
.tech-item .fa-git-alt { color: #f05032; }

/* ====================
   4. LOADER ANIMATION
   ==================== */

.loader {
    animation: spin 1s linear infinite;
}

/* ====================
   5. FLOATING ELEMENTS
   ==================== */

.floating-element.shape-1 {
    animation: float 20s infinite ease-in-out;
}

.floating-element.shape-2 {
    animation: float 25s infinite ease-in-out reverse;
}

/* ====================
   6. TIMELINE ANIMATION
   ==================== */

.timeline-item {
    opacity: 0;
    transform: translateY(30px);
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s ease;
}

/* ====================
   7. SKILL BARS ANIMATION
   ==================== */

.skill-progress {
    animation: progress-bar 1.5s ease-out forwards;
    animation-play-state: paused;
}

.skill-progress.animated {
    animation-play-state: running;
}

/* ====================
   8. CODE EDITOR SYNTAX
   ==================== */

.code-snippet .keyword { color: #ff79c6; }
.code-snippet .function { color: #50fa7b; }
.code-snippet .string { color: #f1fa8c; }
.code-snippet .comment { color: #6272a4; }
.code-snippet .variable { color: #8be9fd; }

.light-theme .code-snippet .keyword { color: #d73a49; }
.light-theme .code-snippet .function { color: #6f42c1; }
.light-theme .code-snippet .string { color: #032f62; }
.light-theme .code-snippet .comment { color: #6a737d; }
.light-theme .code-snippet .variable { color: #005cc5; }

/* ====================
   9. TESTIMONIALS SLIDER
   ==================== */

.testimonial-track {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-dot.active {
    transform: scale(1.2);
    transition: transform 0.3s ease;
}

/* ====================
   10. NOTIFICATIONS ANIMATIONS
   ==================== */

.pwa-notification {
    animation: slideInRight 0.3s ease;
}

.pwa-notification.hiding {
    animation: slideOutRight 0.3s ease forwards;
}

/* ====================
   11. HOVER EFFECTS ENHANCED
   ==================== */

.btn:hover {
    transform: translateY(-3px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover {
    transform: translateY(-10px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tech-item:hover {
    transform: translateY(-10px) scale(1.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-card:hover {
    transform: translateY(-10px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ====================
   12. SCROLL ANIMATIONS
   ==================== */

.scroll-progress {
    transition: width 0.1s ease;
}

.back-to-top {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ====================
   13. WHATSAPP PULSE
   ==================== */

.whatsapp-float i {
    animation: pulse 2s infinite;
}

/* ====================
   14. STATS COUNTER
   ==================== */

.stat-number {
    transition: all 1s ease-out;
}

/* ====================
   15. PAGE TRANSITIONS
   ==================== */

.page-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s, transform 0.5s;
}

.page-exit {
    opacity: 1;
    transform: translateY(0);
}

.page-exit-active {
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.5s, transform 0.5s;
}

/* ====================
   16. PARTICLES ENHANCEMENT
   ==================== */

.particles-container {
    opacity: 0.6;
    transition: opacity 0.5s ease;
}

.light-theme .particles-container {
    opacity: 0.4;
}

.particles-container:hover {
    opacity: 0.8;
}

#testimonials-particles {
    opacity: 0.3;
}

/* ====================
   17. FOCUS ANIMATIONS
   ==================== */

.form-input:focus {
    animation: input-focus 0.3s ease;
}

@keyframes input-focus {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
    50% { box-shadow: 0 0 0 10px rgba(37, 99, 235, 0.1); }
    100% { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
}

/* ====================
   18. RIPPLE EFFECT
   ==================== */

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.6);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.ripple:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

/* ====================
   19. GLOW EFFECT
   ==================== */

.glow {
    position: relative;
}

.glow::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-primary);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.glow:hover::before {
    opacity: 0.3;
    animation: glow-pulse 2s infinite;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* ====================
   20. SHAKE ANIMATION
   ==================== */

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* ====================
   21. BOUNCE ANIMATION
   ==================== */

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.bounce {
    animation: bounce 1s infinite;
}

/* ====================
   22. FLIP ANIMATION
   ==================== */

@keyframes flip {
    0% { transform: perspective(400px) rotateY(0); }
    50% { transform: perspective(400px) rotateY(180deg); }
    100% { transform: perspective(400px) rotateY(360deg); }
}

.flip {
    animation: flip 2s linear infinite;
}

/* ====================
   23. ZOOM ANIMATION
   ==================== */

@keyframes zoom {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.zoom {
    animation: zoom 2s ease-in-out infinite;
}

/* ====================
   24. SLIDE IN ANIMATIONS
   ==================== */

.slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

@keyframes slideInLeft {
    from { transform: translateX(-100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.slide-in-right {
    animation: slideInRight 0.8s ease-out;
}

.slide-in-up {
    animation: fadeInUp 0.8s ease-out;
}

/* ====================
   25. STAGGERED ANIMATIONS
   ==================== */

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

/* ====================
   26. PWA INSTALL BUTTON
   ==================== */

.pwa-install-btn {
    animation: slideInRight 0.5s ease forwards;
    animation-delay: 2s;
}

.pwa-install-btn.hide {
    animation: slideOutRight 0.5s ease forwards;
}

/* ====================
   27. LOADING DOTS
   ==================== */

.loading-dots::after {
    content: '.';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60% { content: '...'; }
    80%, 100% { content: ''; }
}

/* ====================
   28. PROGRESSIVE LOADING
   ==================== */

.fade-in {
    opacity: 0;
    animation: fadeIn 0.5s ease-in forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }
.fade-in-delay-3 { animation-delay: 0.3s; }
.fade-in-delay-4 { animation-delay: 0.4s; }

/* ====================
   29. RESPONSIVE ANIMATIONS
   ==================== */

@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;
    }
}

/* ====================
   30. PRINT STYLES
   ==================== */

@media print {
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
    
    * {
        animation: none !important;
        transition: none !important;
    }
    
    .hero, .cta-section, .whatsapp-float, .theme-toggle, .back-to-top {
        break-inside: avoid;
    }
}