/* ===================================
   SELLIO - ANIMATIONS & EFFECTS
   =================================== */

/* ===================================
   SCROLL ANIMATIONS (AOS overrides)
   =================================== */

[data-aos] {
    opacity: 0;
    transition-property: opacity, transform;
}

[data-aos].aos-animate {
    opacity: 1;
}

[data-aos="fade-up"] {
    transform: translateY(30px);
}

[data-aos="fade-up"].aos-animate {
    transform: translateY(0);
}

[data-aos="fade-down"] {
    transform: translateY(-30px);
}

[data-aos="fade-down"].aos-animate {
    transform: translateY(0);
}

[data-aos="fade-left"] {
    transform: translateX(30px);
}

[data-aos="fade-left"].aos-animate {
    transform: translateX(0);
}

[data-aos="fade-right"] {
    transform: translateX(-30px);
}

[data-aos="fade-right"].aos-animate {
    transform: translateX(0);
}

[data-aos="zoom-in"] {
    transform: scale(0.8);
}

[data-aos="zoom-in"].aos-animate {
    transform: scale(1);
}

/* ===================================
   CUSTOM KEYFRAME ANIMATIONS
   =================================== */

/* Floating Animation for Hero Background Elements */
@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.1;
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
        opacity: 0.15;
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
        opacity: 0.08;
    }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* Gradient Animation */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Bounce Animation */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Spin Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Slide In from Left */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Slide In from Right */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Scale In */
@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===================================
   INTERACTIVE ANIMATIONS
   =================================== */

/* Button Hover Effects */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

/* Card Hover Effects */
.channel-card,
.agent-card,
.step-card {
    position: relative;
    overflow: hidden;
}

.channel-card::after,
.agent-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s;
}

.channel-card:hover::after,
.agent-card:hover::after {
    left: 100%;
}

/* Icon Rotation on Hover */
.step-icon,
.channel-icon,
.agent-icon {
    transition: transform var(--transition-base);
}

.step-card:hover .step-icon,
.channel-card:hover .channel-icon,
.agent-card:hover .agent-icon {
    animation: pulse 1s ease-in-out infinite;
}

/* Link Underline Animation */
.nav-list a {
    position: relative;
}

.nav-list a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--transition-base);
}

.nav-list a:hover::after {
    width: 100%;
}

/* ===================================
   LOADING ANIMATIONS
   =================================== */

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--color-light-gray);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-dots::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

/* ===================================
   TESTIMONIAL CAROUSEL ANIMATIONS
   =================================== */

.testimonial-card {
    animation: fadeIn 0.5s ease-in-out;
}

.testimonial-card.slide-out-left {
    animation: slideOutLeft 0.5s ease-in-out;
}

.testimonial-card.slide-out-right {
    animation: slideOutRight 0.5s ease-in-out;
}

.testimonial-card.slide-in-left {
    animation: slideInLeft 0.5s ease-in-out;
}

.testimonial-card.slide-in-right {
    animation: slideInRight 0.5s ease-in-out;
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ===================================
   FORM ANIMATIONS
   =================================== */

.form-group input,
.form-group select {
    transition: all var(--transition-base);
}

.form-group input:focus,
.form-group select:focus {
    transform: translateY(-2px);
}

/* Success/Error States */
.form-group.success input {
    border-color: var(--color-ai-green);
    animation: successPulse 0.5s ease-in-out;
}

.form-group.error input {
    border-color: #FF4757;
    animation: shake 0.5s ease-in-out;
}

@keyframes successPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 229, 160, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(0, 229, 160, 0);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* ===================================
   SCROLL PROGRESS INDICATOR
   =================================== */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 4px;
    background: var(--gradient-primary);
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* ===================================
   BACK TO TOP BUTTON
   =================================== */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    color: var(--color-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-base);
    z-index: 999;
    box-shadow: var(--shadow-lg);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

/* ===================================
   STATS COUNTER ANIMATION
   =================================== */

.stat-number {
    counter-reset: number;
    animation: countUp 2s ease-out forwards;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   GRADIENT BACKGROUND ANIMATION
   =================================== */

.animated-gradient {
    background: linear-gradient(
        270deg,
        var(--color-primary),
        var(--color-purple),
        var(--color-ai-green)
    );
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

/* ===================================
   TYPEWRITER EFFECT
   =================================== */

.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--color-primary);
    white-space: nowrap;
    animation: typing 3s steps(40) forwards, blink 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* ===================================
   PARALLAX EFFECT (for hero background)
   =================================== */

.parallax {
    transform: translateY(0);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ===================================
   MODAL ANIMATIONS
   =================================== */

.modal {
    animation: modalFadeIn 0.3s ease-in-out;
}

.modal-content {
    animation: modalSlideIn 0.3s ease-in-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===================================
   SKELETON LOADING
   =================================== */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-light-gray) 25%,
        #e0e0e0 50%,
        var(--color-light-gray) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ===================================
   NUMBER INCREMENT ANIMATION
   =================================== */

.increment-number {
    animation: incrementUp 2s ease-out forwards;
}

@keyframes incrementUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===================================
   STAGGER ANIMATIONS (for lists)
   =================================== */

.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    animation: staggerFadeIn 0.5s ease-out forwards;
}

.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; }

@keyframes staggerFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   REDUCED MOTION SUPPORT
   =================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .floating-element,
    .animated-gradient,
    .typewriter,
    .loading-spinner {
        animation: none !important;
    }
}
