/* ========================================
   Simple IA Landing Page - Custom Styles
   ======================================== */

/* Background dot pattern */
.bg-dots {
    background-image: radial-gradient(circle at 1px 1px, #e5e7eb 1px, transparent 0);
    background-size: 24px 24px;
}

/* ========================================
   Animations
   ======================================== */

/* Fade in up animation for scroll reveals */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Float animation for hero mockup */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-12px);
    }
}

.float-animation {
    animation: float 4s ease-in-out infinite;
}

.float-animation-delayed {
    animation: float 4s ease-in-out infinite;
    animation-delay: 1s;
}

/* Message slide animation for chat mockup */
@keyframes messageSlide {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-slide {
    opacity: 0;
    animation: messageSlide 0.5s ease-out forwards;
}

/* Gradient background animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animated-gradient {
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

/* Pulse animation for badges */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

/* ========================================
   Tab Styles
   ======================================== */

.tab-btn {
    background-color: #f3f4f6;
    color: #6b7280;
    border: 1px solid transparent;
}

.tab-btn:hover {
    background-color: #e5e7eb;
    color: #374151;
}

.tab-btn.active {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   FAQ Accordion Styles
   ======================================== */

.faq-item {
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: #d1d5db;
}

.faq-trigger {
    cursor: pointer;
    transition: all 0.2s ease;
}

.faq-trigger:hover {
    background-color: #f9fafb;
}

.faq-icon {
    transition: transform 0.3s ease;
}

.faq-item.open .faq-icon {
    transform: rotate(180deg);
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.open .faq-content {
    max-height: 500px;
}

/* ========================================
   Smooth Scroll Behavior
   ======================================== */

html {
    scroll-behavior: smooth;
}

/* ========================================
   Custom Scrollbar
   ======================================== */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ========================================
   Selection Styles
   ======================================== */

::selection {
    background-color: #3b82f6;
    color: white;
}

/* ========================================
   Focus States
   ======================================== */

a:focus-visible,
button:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ========================================
   Hero Micro-animations
   ======================================== */

/* Subtle floating for mock preview */
@keyframes floatSubtle {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

.float-subtle {
    animation: floatSubtle 5s ease-in-out infinite;
}

/* Shimmer effect for "IA." text */
@keyframes shimmerText {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.text-shimmer {
    /* Fallback color for browsers that don't support background-clip: text */
    color: #3b82f6;

    display: inline-block;
    background: linear-gradient(
        90deg,
        #2563eb 0%,
        #3b82f6 25%,
        #60a5fa 50%,
        #3b82f6 75%,
        #2563eb 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmerText 3s linear infinite;

    /* Force hardware acceleration for iOS */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: background-position;
}

/* Fallback for browsers that don't support background-clip: text */
@supports not (background-clip: text) or not (-webkit-background-clip: text) {
    .text-shimmer {
        color: #3b82f6;
        background: none;
        -webkit-text-fill-color: currentColor;
        animation: none;
    }
}

/* Fade slide up for hero content */
@keyframes fadeSlideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-slide-up {
    animation: fadeSlideUp 0.8s ease-out forwards;
}

/* Staggered chip animations - Refined for smoothness */
@keyframes chipFadeIn {
    0% {
        opacity: 0;
        transform: translateY(5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.chip-stagger {
    opacity: 0;
    animation: chipFadeIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.chip-stagger:nth-child(1) {
    animation-delay: 0.9s;
}

.chip-stagger:nth-child(2) {
    animation-delay: 1.1s;
}

.chip-stagger:nth-child(3) {
    animation-delay: 1.3s;
}

/* Mobile mockup on scroll reveal */
.mobile-mockup-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-mockup-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media (max-width: 1023px) {
    /* Disable floating animations on tablets and mobile for better performance */
    .float-subtle {
        animation: none;
    }
}

@media (max-width: 768px) {
    .mockup-container {
        transform: scale(0.9);
        transform-origin: center;
    }

    .float-animation,
    .float-animation-delayed {
        animation: none;
    }
}

@media (max-width: 640px) {
    .mockup-container {
        transform: scale(0.85);
    }
}

/* ========================================
   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;
    }

    .float-animation,
    .float-animation-delayed,
    .float-subtle,
    .text-shimmer,
    .chip-stagger,
    .fade-slide-up,
    .message-slide,
    .mobile-mockup-scroll {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .text-shimmer {
        color: #3b82f6 !important;
        background: none !important;
        -webkit-text-fill-color: currentColor !important;
    }
}

/* ========================================
   Loading State
   ======================================== */

.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% {
        left: 100%;
    }
}

/* ========================================
   Hover Effects for Cards
   ======================================== */

.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ========================================
   Button Effects
   ======================================== */

.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    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 ease;
}

.btn-primary:hover::before {
    left: 100%;
}

/* ========================================
   Text Gradient (optional)
   ======================================== */

.text-gradient {
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   WhatsApp Chat Animation Enhancement
   ======================================== */

.message-slide:nth-child(1) { animation-delay: 0.5s; }
.message-slide:nth-child(2) { animation-delay: 1.5s; }
.message-slide:nth-child(3) { animation-delay: 2.5s; }
.message-slide:nth-child(4) { animation-delay: 3.5s; }

/* Typing indicator animation */
@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

.typing-dot {
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* ========================================
   Hero "IA." Text Effect
   ======================================== */

/* Shimmer animation for desktop gradient */
@keyframes heroIaShimmer {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Color pulse animation for mobile - simple and iOS compatible */
@keyframes heroIaColorPulse {
    0%, 100% {
        color: #2563eb;
    }
    50% {
        color: #60a5fa;
    }
}

/* Base styles for IA text */
.hero-ia {
    display: inline-block;
    font-weight: 800;
}

/* Mobile: animated color pulse (iOS compatible) */
@media (max-width: 1023px) {
    .hero-ia {
        color: #2563eb;
        -webkit-animation: heroIaColorPulse 2s ease-in-out infinite !important;
        animation: heroIaColorPulse 2s ease-in-out infinite !important;
    }
}

/* Ensure animation works even with global reduced motion overrides */
@media (max-width: 1023px) and (prefers-reduced-motion: no-preference) {
    .hero-ia {
        -webkit-animation: heroIaColorPulse 2s ease-in-out infinite !important;
        animation: heroIaColorPulse 2s ease-in-out infinite !important;
    }
}

/* Desktop: gradient text effect with shimmer animation */
@media (min-width: 1024px) {
    .hero-ia {
        background: linear-gradient(90deg, #2563eb 0%, #3b82f6 25%, #60a5fa 50%, #3b82f6 75%, #2563eb 100%);
        background-size: 200% 100%;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        -webkit-animation: heroIaShimmer 3.5s ease-in-out infinite;
        animation: heroIaShimmer 3.5s ease-in-out infinite;
    }
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .hero-ia {
        -webkit-animation: none !important;
        animation: none !important;
        color: #2563eb !important;
    }
}

@media (prefers-reduced-motion: reduce) and (min-width: 1024px) {
    .hero-ia {
        background-position: 50% 50% !important;
    }
}

/* ========================================
   Mobile Demo Card Animation
   ======================================== */

/* Staggered step animation: opacity 0→1 + translateY(6px→0) */
@keyframes mobileStepAppear {
    0% {
        opacity: 0;
        transform: translateY(6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-step {
    animation: mobileStepAppear 500ms ease-out forwards;
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .mobile-step {
        animation: none;
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Mobile Mini Chat Enter Animation
   ======================================== */

@keyframes mobileChatEnter {
    0% {
        opacity: 0;
        transform: translateY(12px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-chat-enter {
    opacity: 0;
    animation: mobileChatEnter 400ms ease-out 200ms forwards;
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .mobile-chat-enter {
        animation: none;
        opacity: 1;
        transform: translateY(0);
    }
}
