/* ========================================
   AGENCIA IA - Animations
   ======================================== */

/* ========================================
   Keyframe Animations
   ======================================== */

/* Glow Pulse */
@keyframes pulse-glow {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.8));
    }
}

/* Float */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Rotate */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Scale In */
@keyframes scale-in {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Slide In Left */
@keyframes slide-in-left {
    from {
        transform: translateX(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Slide In Right */
@keyframes slide-in-right {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Slide In Up */
@keyframes slide-in-up {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Fade In */
@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Gradient Shift */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Border Glow */
@keyframes border-glow {
    0%, 100% {
        border-color: rgba(99, 102, 241, 0.3);
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
    }
    50% {
        border-color: rgba(99, 102, 241, 0.6);
        box-shadow: 0 0 40px rgba(99, 102, 241, 0.4);
    }
}

/* Text Glow */
@keyframes text-glow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    }
    50% {
        text-shadow: 0 0 20px rgba(99, 102, 241, 0.8), 0 0 30px rgba(99, 102, 241, 0.5);
    }
}

/* Orb Float */
@keyframes orb-float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -30px) scale(1.05);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }
    75% {
        transform: translate(20px, 30px) scale(1.02);
    }
}

/* Shimmer */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ========================================
   Animation Classes
   ======================================== */

/* Animated Elements */
.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-rotate {
    animation: rotate 20s linear infinite;
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

.animate-border-glow {
    animation: border-glow 2s ease-in-out infinite;
}

.animate-text-glow {
    animation: text-glow 2s ease-in-out infinite;
}

/* Orb Animations */
.animate-orb-1 {
    animation: orb-float 15s ease-in-out infinite;
}

.animate-orb-2 {
    animation: orb-float 18s ease-in-out infinite reverse;
}

.animate-orb-3 {
    animation: orb-float 12s ease-in-out infinite;
}

/* ========================================
   Scroll-triggered Animations
   ======================================== */

/* Stagger delays for children */
.stagger-children > *:nth-child(1) { transition-delay: 0ms; }
.stagger-children > *:nth-child(2) { transition-delay: 100ms; }
.stagger-children > *:nth-child(3) { transition-delay: 200ms; }
.stagger-children > *:nth-child(4) { transition-delay: 300ms; }
.stagger-children > *:nth-child(5) { transition-delay: 400ms; }
.stagger-children > *:nth-child(6) { transition-delay: 500ms; }

/* ========================================
   Interactive Hover Effects
   ======================================== */

/* Card Tilt Effect */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.tilt-card:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

/* Magnetic Button */
.magnetic-btn {
    transition: transform 0.3s ease;
}

.magnetic-btn:hover {
    transform: scale(1.05);
}

/* Line Reveal */
.line-reveal {
    position: relative;
    overflow: hidden;
}

.line-reveal::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.line-reveal:hover::after {
    transform: scaleX(1);
}

/* ========================================
   Parallax Effects
   ======================================== */

.parallax-container {
    overflow: hidden;
    position: relative;
}

.parallax-layer {
    position: absolute;
    inset: -20%;
    will-change: transform;
}

/* ========================================
   Loading States
   ======================================== */

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-card) 25%,
        var(--bg-card-hover) 50%,
        var(--bg-card) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 1s ease;
}

.progress-bar-fill.animate {
    transform: scaleX(1);
}

/* ========================================
   Cursor Effects
   ======================================== */

/* Cursor Trail */
.cursor-trail {
    position: fixed;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9997;
}

.cursor-trail.active {
    opacity: 0.3;
    transform: scale(1);
}

/* ========================================
   Performance Optimizations
   ======================================== */

/* GPU Acceleration */
.gpu-accelerated {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ========================================
   Animations always enabled
   ======================================== */

/* Respect reduced motion preference */
@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;
    }
}

/* ========================================
   Special Effects
   ======================================== */

/* Glow Border on Hover */
.glow-border {
    position: relative;
}

.glow-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--gradient-primary);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.glow-border:hover::before {
    opacity: 1;
}

/* Gradient Text Animation */
.gradient-text-animated {
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--secondary) 25%,
        var(--accent) 50%,
        var(--primary) 75%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s linear infinite;
}

/* Neon Glow */
.neon-glow {
    text-shadow: 
        0 0 5px var(--primary),
        0 0 10px var(--primary),
        0 0 20px var(--primary),
        0 0 40px var(--primary);
}

/* ========================================
   Page Transitions
   ======================================== */

/* Section Reveal */
.section-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Custom Scrollbar
   ======================================== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-primary);
}

/* ========================================
   Selection Styles
   ======================================== */

::selection {
    background: var(--primary);
    color: white;
}

::-moz-selection {
    background: var(--primary);
    color: white;
}

/* ========================================
   Hero Card Talking Animation
   ======================================== */

.hero-card .card-content .card-line {
    transform-origin: left center;
}

@keyframes talking-line-1 {
    0%, 100% { width: 70%; }
    25% { width: 85%; }
    50% { width: 60%; }
    75% { width: 75%; }
}

@keyframes talking-line-2 {
    0%, 100% { width: 80%; }
    25% { width: 65%; }
    50% { width: 90%; }
    75% { width: 70%; }
}

@keyframes talking-line-3 {
    0%, 100% { width: 75%; }
    30% { width: 85%; }
    60% { width: 55%; }
    80% { width: 80%; }
}

@keyframes talking-line-4 {
    0%, 100% { width: 65%; }
    20% { width: 80%; }
    45% { width: 60%; }
    70% { width: 85%; }
}

.hero-card .card-content .card-line:nth-child(1) {
    animation: talking-line-1 3s ease-in-out infinite;
}

.hero-card .card-content .card-line:nth-child(2) {
    animation: talking-line-2 3.5s ease-in-out infinite;
    animation-delay: 0.3s;
}

.hero-card .card-content .card-line:nth-child(3) {
    animation: talking-line-3 2.8s ease-in-out infinite;
    animation-delay: 0.6s;
}

.hero-card .card-content .card-line:nth-child(4) {
    animation: talking-line-4 3.2s ease-in-out infinite;
    animation-delay: 0.9s;
}

/* Card avatar pulse while "talking" */
.hero-card .card-avatar {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Card subtle float */
.hero-card {
    animation: float 6s ease-in-out infinite;
}
