/* ==========================================================================
   AI Theme — Violet/Purple Accent Overrides
   Applied only to ai-services.html via <link> tag
   ========================================================================== */

/* --- AI Color Palette --- */
.ai-page {
    --ai-primary: #6C5CE7;
    --ai-primary-hover: #5A4BD1;
    --ai-primary-light: rgba(108, 92, 231, 0.1);
    --ai-primary-glow: rgba(108, 92, 231, 0.3);
    --ai-gradient: linear-gradient(135deg, #6C5CE7 0%, #a29bfe 100%);
    --ai-dark: #1a1136;
    --ai-accent: #DDAF5B;
}

/* --- AI Hero Section --- */
.ai-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 130px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1136 0%, #2d1b69 30%, #6C5CE7 100%);
}

.ai-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.ai-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
}

.ai-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(26, 17, 54, 0.92) 0%, rgba(108, 92, 231, 0.7) 100%);
    z-index: 1;
}

/* Animated grid pattern */
.ai-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(108, 92, 231, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(108, 92, 231, 0.08) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 1;
    animation: gridPulse 8s ease-in-out infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

.ai-hero .hero-container {
    position: relative;
    z-index: 2;
}

.ai-hero .badge {
    background: rgba(108, 92, 231, 0.2);
    color: #a29bfe;
    border-color: rgba(108, 92, 231, 0.4);
}

.ai-hero .hero-title {
    color: #ffffff;
}

.ai-hero .hero-title span {
    background: linear-gradient(135deg, #a29bfe, #DDAF5B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-hero .hero-subtitle {
    color: rgba(255, 255, 255, 0.85);
}

.ai-hero .btn-primary {
    background: var(--ai-primary);
}

.ai-hero .btn-primary:hover {
    background: var(--ai-primary-hover);
}

.ai-hero .hero-stats {
    border-top-color: rgba(108, 92, 231, 0.3);
}

.ai-hero .stat-number {
    color: #a29bfe;
}

/* Floating particles effect */
.ai-particles {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.ai-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(162, 155, 254, 0.6);
    border-radius: 50%;
    animation: particleFloat 15s infinite ease-in-out;
}

.ai-particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; animation-duration: 12s; }
.ai-particle:nth-child(2) { left: 30%; top: 60%; animation-delay: 2s; animation-duration: 18s; }
.ai-particle:nth-child(3) { left: 50%; top: 30%; animation-delay: 4s; animation-duration: 14s; }
.ai-particle:nth-child(4) { left: 70%; top: 70%; animation-delay: 1s; animation-duration: 16s; }
.ai-particle:nth-child(5) { left: 85%; top: 40%; animation-delay: 3s; animation-duration: 20s; }
.ai-particle:nth-child(6) { left: 20%; top: 80%; animation-delay: 5s; animation-duration: 13s; }
.ai-particle:nth-child(7) { left: 60%; top: 15%; animation-delay: 7s; animation-duration: 17s; }
.ai-particle:nth-child(8) { left: 90%; top: 55%; animation-delay: 6s; animation-duration: 11s; }

@keyframes particleFloat {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0; }
    10% { opacity: 1; }
    50% { transform: translate(-30px, -60px) scale(1.5); opacity: 0.8; }
    90% { opacity: 1; }
}

/* --- AI Service Cards --- */
.ai-service-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.ai-service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--ai-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.ai-service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(108, 92, 231, 0.1);
    border-bottom-color: var(--ai-primary);
}

.ai-service-card:hover::before {
    transform: scaleX(1);
}

.ai-service-card .service-icon {
    background: var(--ai-primary-light);
    color: var(--ai-primary);
}

.ai-service-card h3 {
    font-size: clamp(1.1rem, 1.5vw, 1.3rem);
    margin-bottom: 1rem;
}

.ai-service-card > p {
    font-size: 0.95rem;
    color: var(--text-body);
    margin-bottom: 1rem;
}

.ai-business-insight {
    background: rgba(108, 92, 231, 0.04);
    border-left: 3px solid var(--ai-primary);
    padding: 1rem 1.2rem;
    margin-top: 1rem;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
    color: var(--text-body);
    line-height: 1.7;
    font-style: italic;
}

.ai-business-insight strong {
    color: var(--ai-primary);
    font-style: normal;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 0.3rem;
}

/* --- AI Capabilities Grid — 2×2 Layout --- */
.ai-capabilities-grid {
    grid-template-columns: repeat(2, 1fr) !important;
}

/* --- Showcase Section (Built & Deployed) --- */
.showcase-section {
    background: var(--bg-secondary);
}

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.showcase-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.showcase-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(108, 92, 231, 0.15);
}

.showcase-image {
    position: relative;
    height: 260px;
    overflow: hidden;
}

.showcase-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
    transition: transform 0.6s ease;
}

.showcase-card:hover .showcase-image img {
    transform: scale(1.05);
}

.showcase-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(transparent 0%, rgba(26, 17, 54, 0.85) 100%);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.showcase-overlay .showcase-tag {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    background: rgba(108, 92, 231, 0.9);
    color: #fff;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.showcase-overlay h3 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.showcase-body {
    padding: 1.5rem;
}

.showcase-body p {
    font-size: 0.92rem;
    color: var(--text-body);
    line-height: 1.6;
}

/* --- ML Evidence Strip --- */
.ml-evidence-strip {
    background: var(--text-heading);
    padding: clamp(3rem, 5vw, 5rem) 0;
    overflow: hidden;
}

.ml-evidence-strip .section-title {
    color: #fff;
}

.ml-evidence-strip .section-subtitle {
    color: rgba(255, 255, 255, 0.7);
}

.ml-evidence-strip .section-title::after {
    background-color: var(--ai-primary);
}

.evidence-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.evidence-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.evidence-card:hover {
    transform: translateY(-4px);
    border-color: rgba(108, 92, 231, 0.4);
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.2);
}

.evidence-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #fff;
    padding: 0.5rem;
    border-radius: 12px 12px 0 0;
}

.evidence-card .evidence-label {
    padding: 0.8rem 1.2rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    font-weight: 500;
}

.evidence-card .evidence-label span {
    display: block;
    font-size: 0.7rem;
    color: rgba(162, 155, 254, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
}

/* --- AI Industries / Use Cases --- */
.ai-industries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.ai-industry-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
}

.ai-industry-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.1);
    border-color: rgba(108, 92, 231, 0.3);
}

.ai-industry-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.ai-industry-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.ai-industry-card p {
    font-size: 0.88rem;
    color: var(--text-light);
}

/* --- Cross-Sell Banner --- */
.cross-sell-banner {
    background: linear-gradient(135deg, var(--ai-primary) 0%, #a29bfe 100%);
    padding: 3rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cross-sell-banner.engineering-cross-sell {
    background: linear-gradient(135deg, #3D7377 0%, #5a9ea3 100%);
}

.cross-sell-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
}

.cross-sell-banner .container {
    position: relative;
    z-index: 1;
}

.cross-sell-banner h2 {
    color: #fff;
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    margin-bottom: 0.8rem;
}

.cross-sell-banner h2::after {
    display: none;
}

.cross-sell-banner p {
    color: rgba(255, 255, 255, 0.85);
    max-width: 600px;
    margin: 0 auto 1.5rem;
    font-size: 1rem;
}

.cross-sell-banner .btn {
    background: #fff;
    color: var(--ai-primary);
    font-weight: 700;
    border: none;
}

.cross-sell-banner .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.cross-sell-banner.engineering-cross-sell .btn {
    color: #3D7377;
}

/* --- AI Page ambient edge glow override --- */
.ai-page body::before {
    box-shadow:
        inset 6px 0 25px rgba(108, 92, 231, 0.45),
        inset -6px 0 25px rgba(108, 92, 231, 0.45),
        inset 0 4px 18px rgba(221, 175, 91, 0.2),
        inset 0 -4px 18px rgba(221, 175, 91, 0.2);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .ai-hero {
        padding-top: 100px;
        min-height: auto;
        padding-bottom: 3rem;
    }

    .showcase-image {
        height: 200px;
    }

    .evidence-gallery {
        grid-template-columns: 1fr 1fr;
    }

    .ai-industries-grid {
        grid-template-columns: 1fr 1fr;
    }

    .showcase-grid {
        grid-template-columns: 1fr;
    }

    .ai-capabilities-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .evidence-gallery {
        grid-template-columns: 1fr;
    }

    .ai-industries-grid {
        grid-template-columns: 1fr;
    }

    .showcase-image {
        height: 180px;
    }
}
