/* ============================================
   AI Services Section - Animated Background (Even Section)
   ============================================ */

.ai-services-section {
    background: 
        linear-gradient(135deg, #fafbff 0%, #f0f4ff 25%, #ffffff 50%, #f8faff 75%, #fafbff 100%),
        linear-gradient(45deg, rgba(42, 193, 174, 0.03) 0%, rgba(139, 92, 246, 0.03) 100%),
        /* Subtle wave pattern */
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 50px,
            rgba(42, 193, 174, 0.01) 51px,
            rgba(42, 193, 174, 0.01) 52px,
            transparent 53px
        );
    padding: 90px 0;
    position: relative;
    overflow: hidden;
}

/* Animated Floating Objects */
.ai-services-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        /* Floating circles */
        radial-gradient(circle 40px at 15% 20%, rgba(42, 193, 174, 0.08) 0%, transparent 70%),
        radial-gradient(circle 60px at 85% 30%, rgba(139, 92, 246, 0.06) 0%, transparent 70%),
        radial-gradient(circle 35px at 25% 70%, rgba(6, 182, 212, 0.07) 0%, transparent 70%),
        radial-gradient(circle 50px at 75% 80%, rgba(42, 193, 174, 0.05) 0%, transparent 70%),
        radial-gradient(circle 45px at 50% 15%, rgba(139, 92, 246, 0.06) 0%, transparent 70%),
        radial-gradient(circle 30px at 90% 60%, rgba(6, 182, 212, 0.08) 0%, transparent 70%);
    animation: floatingObjects 25s ease-in-out infinite;
    pointer-events: none;
}

/* Geometric Shapes Layer */
.ai-services-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        /* Triangle shapes */
        linear-gradient(45deg, transparent 48%, rgba(42, 193, 174, 0.04) 49%, rgba(42, 193, 174, 0.04) 51%, transparent 52%),
        linear-gradient(-45deg, transparent 48%, rgba(139, 92, 246, 0.03) 49%, rgba(139, 92, 246, 0.03) 51%, transparent 52%),
        /* Hexagon pattern */
        radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.02) 20%, transparent 21%);
    background-size: 120px 120px, 100px 100px, 80px 80px;
    background-position: 0 0, 60px 60px, 40px 40px;
    animation: geometricShift 30s linear infinite;
    pointer-events: none;
    opacity: 0.7;
}

/* Floating Animation */
@keyframes floatingObjects {
    0%, 100% {
        transform: translateY(0px) translateX(0px) rotate(0deg);
        opacity: 0.6;
    }
    25% {
        transform: translateY(-15px) translateX(10px) rotate(90deg);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-25px) translateX(-5px) rotate(180deg);
        opacity: 1;
    }
    75% {
        transform: translateY(-10px) translateX(-15px) rotate(270deg);
        opacity: 0.7;
    }
}

/* Geometric Shift Animation */
@keyframes geometricShift {
    0% {
        background-position: 0 0, 60px 60px, 40px 40px;
        transform: rotate(0deg);
    }
    50% {
        background-position: 60px 60px, 120px 120px, 80px 80px;
        transform: rotate(1deg);
    }
    100% {
        background-position: 120px 120px, 180px 180px, 120px 120px;
        transform: rotate(0deg);
    }
}

/* Section Headers */
.services-main-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3.2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.services-main-title::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #2BC7B4, #8B5CF6);
    border-radius: 2px;
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { 
        opacity: 0.7;
        transform: translateX(-50%) scaleX(1);
    }
    50% { 
        opacity: 1;
        transform: translateX(-50%) scaleX(1.2);
    }
}

.services-subtitle {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 0;
    position: relative;
    z-index: 2;
}

/* AI Service Cards */
.ai-service-card {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border-radius: 24px;
    padding: 2.5rem 2rem;
    border: 2px solid #e2e8f0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    height: 100%;
    z-index: 10;
    
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.05),
        0 2px 8px rgba(0, 0, 0, 0.04);
    opacity: 0;
    transform: translateY(30px);
    animation: aiServiceFadeInUp 0.8s ease forwards;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    isolation: isolate;
}

/* Force white background for all AI service cards */
.ai-services-section .ai-service-card,
.ai-services-section .ai-service-card * {
    background-attachment: scroll !important;
}

.ai-services-section .col-lg-4 .ai-service-card,
.ai-services-section .col-md-6 .ai-service-card,
.ai-services-section .col-md-12 .ai-service-card {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
}

.ai-service-card:nth-child(1) { animation-delay: 0.2s; }
.ai-service-card:nth-child(2) { animation-delay: 0.4s; }
.ai-service-card:nth-child(3) { animation-delay: 0.6s; }

@keyframes aiServiceFadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover Effects - Outside Card */
.ai-service-card::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(135deg, #2BC7B4, #8B5CF6, #06B6D4, #2BC7B4);
    border-radius: 29px;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
    animation: aiServiceRotateBorder 3s linear infinite;
}

.ai-service-card:hover::after {
    opacity: 0.6;
}

.ai-service-card:hover {
    transform: translateY(-12px) scale(1.03);
    border-color: rgba(42, 193, 174, 0.4);
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.15),
        0 15px 30px rgba(42, 193, 174, 0.2),
        0 8px 16px rgba(139, 92, 246, 0.1),
        0 0 40px rgba(6, 182, 212, 0.1);
}

@keyframes aiServiceRotateBorder {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Service Header */
.service-header {
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.service-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: #8B5CF6;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 20px;
    display: inline-block;
    transition: all 0.3s ease;
}

.ai-service-card:hover .service-category {
    background: rgba(139, 92, 246, 0.3);
    color: #553C9A;
    font-weight: 800;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 4px 8px rgba(139, 92, 246, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.service-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    line-height: 1.3;
    transition: all 0.3s ease;
}

.ai-service-card:hover .service-title {
    color: #0f172a;
    font-weight: 800;
    transform: translateY(-3px) scale(1.02);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.service-description {
    font-size: 1rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
    transition: all 0.3s ease;
}

.ai-service-card:hover .service-description {
    color: #1f2937;
    font-weight: 600;
    transform: translateY(-2px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Service Stats */
.ai-service-stats {
    margin: 2rem 0;
    text-align: center;
    position: relative;
    z-index: 2;
}

.ai-stat-highlight {
    padding: 1.5rem;
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-radius: 16px;
    border: 2px solid rgba(42, 193, 174, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.05),
        0 2px 6px rgba(42, 193, 174, 0.1);
}

.ai-stat-highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(42, 193, 174, 0.1), transparent);
    transition: left 0.6s ease;
}

.ai-service-card:hover .ai-stat-highlight::before {
    left: 100%;
}

.ai-service-card:hover .ai-stat-highlight {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-color: rgba(42, 193, 174, 0.4);
    border-width: 3px;
    transform: translateY(-5px) scale(1.02);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.1),
        0 4px 12px rgba(42, 193, 174, 0.2),
        0 0 20px rgba(139, 92, 246, 0.1);
}

.ai-stat-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #2BC7B4;
    display: block;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(42, 193, 174, 0.2);
    transition: all 0.3s ease;
}

.ai-service-card:hover .ai-stat-number {
    color: #059669;
    font-weight: 800;
    transform: scale(1.08) rotateY(360deg);
    text-shadow: 0 3px 6px rgba(5, 150, 105, 0.3);
}

.ai-stat-label {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.ai-service-card:hover .ai-stat-label {
    color: #374151;
    font-weight: 600;
}

/* Service Footer */
.service-footer {
    margin-top: auto;
    position: relative;
    z-index: 2;
}

.service-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #8B5CF6;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
}

.service-link:hover {
    color: #2BC7B4;
    transform: translateX(5px);
    text-decoration: none;
}

.service-link i {
    transition: transform 0.3s ease;
}

.service-link:hover i {
    transform: translateX(3px);
}

/* CTA Section */
.ai-services-cta {
    margin-top: 3rem;
    position: relative;
    z-index: 2;
}

.ai-services-cta .btn {
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
}

.ai-services-cta .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(139, 92, 246, 0.4);
}

.cta-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 992px) {
    .ai-services-section {
        padding: 80px 0;
    }
    
    .services-main-title {
        font-size: 2.8rem;
    }
    
    .services-subtitle {
        font-size: 1.2rem;
    }
    
    .ai-service-card {
        padding: 2rem 1.5rem;
    }
    
    .service-title {
        font-size: 1.3rem;
    }
    
    .stat-number {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .ai-services-section {
        padding: 60px 0;
    }
    
    .services-main-title {
        font-size: 2.4rem;
    }
    
    .services-subtitle {
        font-size: 1.1rem;
    }
    
    .ai-service-card {
        padding: 1.8rem 1.2rem;
        margin-bottom: 2rem;
    }
    
    .service-title {
        font-size: 1.2rem;
    }
    
    .service-description {
        font-size: 0.95rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .ai-services-cta .btn {
        padding: 14px 28px;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .services-main-title {
        font-size: 2rem;
    }
    
    .ai-service-card {
        padding: 1.5rem 1rem;
    }
    
    .service-title {
        font-size: 1.1rem;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
}

/* Performance optimizations */
.ai-service-card {
    will-change: transform;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .ai-service-card,
    .ai-services-section::before,
    .ai-services-section::after {
        animation: none;
    }
    
    .ai-service-card:hover {
        transform: none;
    }
}
