/* ============================================
   NAI IT Theme - Animations
   Keyframes, scroll animations, marquee
   ============================================ */

/* ============================================
   Keyframes
   ============================================ */
@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes scaleIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* ============================================
   Animation Classes
   ============================================ */
.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.5s ease-out;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   Scroll Animations (IntersectionObserver)
   Elements start hidden, become visible on scroll
   ============================================ */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for grids */
.scroll-animate[data-delay="1"] { transition-delay: 0.1s; }
.scroll-animate[data-delay="2"] { transition-delay: 0.2s; }
.scroll-animate[data-delay="3"] { transition-delay: 0.3s; }
.scroll-animate[data-delay="4"] { transition-delay: 0.4s; }
.scroll-animate[data-delay="5"] { transition-delay: 0.5s; }
.scroll-animate[data-delay="6"] { transition-delay: 0.6s; }

/* Variants */
.scroll-animate--fade {
    transform: none;
}

.scroll-animate--slide-left {
    transform: translateX(-30px);
}

.scroll-animate--slide-left.visible {
    transform: translateX(0);
}

.scroll-animate--slide-right {
    transform: translateX(30px);
}

.scroll-animate--slide-right.visible {
    transform: translateX(0);
}

.scroll-animate--scale {
    transform: scale(0.9);
}

.scroll-animate--scale.visible {
    transform: scale(1);
}

/* ============================================
   Marquee / Clients Carousel
   ============================================ */
.clients-carousel {
    overflow: hidden;
    position: relative;
    padding: 16px 0;
}

.clients-carousel::before,
.clients-carousel::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20px;
    z-index: 2;
    pointer-events: none;
}

.clients-carousel::before {
    left: 0;
    background: linear-gradient(to right, var(--carousel-fade), transparent);
}

.clients-carousel::after {
    right: 0;
    background: linear-gradient(to left, var(--carousel-fade), transparent);
}

.clients-carousel__track {
    display: flex;
    align-items: center;
    gap: 48px;
    animation: marquee 30s linear infinite;
    width: max-content;
}

.clients-carousel__track:hover {
    animation-play-state: paused;
}

.clients-carousel__logo {
    height: 32px;
    width: auto;
    opacity: var(--logo-opacity);
    filter: var(--logo-filter);
    transition: opacity 0.3s ease, filter 0.3s ease;
    flex-shrink: 0;
}

.clients-carousel__logo:hover {
    opacity: var(--logo-hover-opacity);
}

@media (min-width: 768px) {
    .clients-carousel__logo {
        height: 40px;
    }
    .clients-carousel__track {
        gap: 64px;
    }
}

/* ============================================
   FAQ Accordion
   ============================================ */
.faq-item {
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.faq-item:hover,
.faq-item.open {
    border-color: var(--border-color);
}

.faq-item__question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 20px 24px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: background-color 0.2s ease;
}

.faq-item__question:hover {
    background: var(--bg-surface);
}

.faq-item__icon {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-item.open .faq-item__icon {
    transform: rotate(180deg);
}

.faq-item__answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.open .faq-item__answer {
    max-height: 500px;
    padding: 0 24px 20px;
}

.faq-item__answer p {
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ============================================
   Support Chat Widget
   ============================================ */
.support-chat {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 997;
}

.support-chat__trigger {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--nai-primary), var(--nai-secondary));
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(0, 125, 183, 0.4);
    transition: all 0.3s ease;
}

.support-chat__trigger:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(0, 125, 183, 0.5);
}

.support-chat__trigger svg {
    width: 24px;
    height: 24px;
}

.support-chat__window {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 380px;
    max-height: 520px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.support-chat__window.open {
    display: flex;
}

.support-chat__header {
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--nai-primary), var(--nai-secondary));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.support-chat__header-title {
    font-weight: 700;
    font-size: 1rem;
}

.support-chat__header-subtitle {
    font-size: 0.75rem;
    opacity: 0.8;
}

.support-chat__close {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.support-chat__close:hover {
    opacity: 1;
}

.support-chat__body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    min-height: 200px;
}

.support-chat__message {
    margin-bottom: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.5;
    max-width: 85%;
}

.support-chat__message--bot {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border-bottom-left-radius: 4px;
}

.support-chat__message--user {
    background: var(--nai-primary);
    color: #ffffff;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.support-chat__quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--border-subtle);
}

.support-chat__quick-btn {
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-surface);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.2s ease;
}

.support-chat__quick-btn:hover {
    border-color: var(--nai-primary);
    color: var(--nai-primary);
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .scroll-animate {
        opacity: 1;
        transform: none;
    }

    .clients-carousel__track {
        animation: none;
    }
}
