/* Services Page Specific Styles */

/* =========================================
   Theme Overrides & Layout
   ========================================= */

body[data-page='services'] {
    /* Local scoped variables for Services page specific theming */
    --services-bg: #f8fafc; /* Slate 50 - Very light cool gray */
    --services-surface: #ffffff;
    --services-primary: #3b82f6; /* Blue 500 - Consistent Brand Color */
    --services-secondary: #0ea5e9; /* Sky 500 */
    --services-accent: #6366f1; /* Indigo 500 - Slight variation for services */
    --services-text: #0f172a; /* Slate 900 */
    --services-muted: #64748b; /* Slate 500 */
    --services-border: #e2e8f0; /* Slate 200 */
    
    /* Map to Global Variables */
    --bg: var(--services-bg);
    --surface: var(--services-surface);
    --primary: var(--services-primary);
    --text: var(--services-text);
    --text-muted: var(--services-muted);
    --border: var(--services-border);
}

/* Dark mode overrides */
:root.theme-dark body[data-page='services'] {
    --services-bg: #0b1220; /* Global Deep Dark */
    --services-surface: #0f172a; /* Global Surface */
    --services-border: #1f2937; /* Global Border */
    --services-text: #e5e7eb; /* Global Text */
    --services-muted: #a1a1aa; /* Global Muted */
    
    /* Re-map for dark mode */
    --bg: var(--services-bg);
    --surface: var(--services-surface);
}

/* Navbar Consistency Override */
body[data-page='services'] .site-header {
    --surface: #ffffff;
    --text: #0f172a;
}

:root.theme-dark body[data-page='services'] .site-header {
    --surface: #0f172a;
    --text: #e5e7eb;
}

/* Global Section Styling */
body[data-page='services'] main.container {
    max-width: 100%;
    width: 100%;
    padding: 0;
    overflow-x: hidden;
    background-color: var(--services-bg);
}

body[data-page='services'] section {
    width: 100%;
    max-width: 100%;
    padding: 8rem 8vw;
    position: relative;
    color: var(--services-text);
}

/* =========================================
   Hero Section
   ========================================= */

/* Hero Section with Cleaning Theme Animation */
body[data-page='services'] .services-hero {
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    /* Beautiful cleaning colors: Sky blue, Cyan, White */
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #bae6fd 100%);
    padding-top: 10rem;
    padding-bottom: 10rem;
    position: relative;
    overflow: hidden;
}

/* Bubbles Animation */
body[data-page='services'] .services-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 20%),
        radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 20%),
        radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.05) 0%, rgba(14, 165, 233, 0) 50%);
    background-size: 100% 100%;
    animation: cleaning-bubbles 15s ease-in-out infinite alternate;
    pointer-events: none;
}

/* Additional animated floating bubbles */
body[data-page='services'] .services-hero::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 90%, rgba(255, 255, 255, 0.6) 10px, transparent 11px),
        radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.6) 20px, transparent 21px),
        radial-gradient(circle at 40% 50%, rgba(186, 230, 253, 0.4) 30px, transparent 31px),
        radial-gradient(circle at 70% 60%, rgba(14, 165, 233, 0.1) 40px, transparent 41px);
    background-size: 100% 100%;
    animation: float-bubbles 20s linear infinite;
    opacity: 0.7;
    z-index: 0;
}

@keyframes cleaning-bubbles {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

@keyframes float-bubbles {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

/* Dark mode adjustment for hero */
:root.theme-dark body[data-page='services'] .services-hero {
    background: linear-gradient(135deg, #0c4a6e 0%, #075985 50%, #0369a1 100%);
}
:root.theme-dark body[data-page='services'] .services-hero::after {
    background-image: 
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 20%),
        radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 20%);
}


body[data-page='services'] .services-hero-inner {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

body[data-page='services'] .services-title {
    font-size: clamp(3rem, 6vw, 5.5rem);
    font-weight: 900;
    background: linear-gradient(135deg, var(--services-text) 30%, var(--services-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

body[data-page='services'] .services-subtitle {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    color: var(--services-muted);
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

body[data-page='services'] .about-badge { 
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background: color-mix(in oklab, var(--services-primary) 10%, transparent);
    color: var(--services-primary);
    border-radius: 100px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.85rem;
    margin-bottom: 2rem;
    border: 1px solid color-mix(in oklab, var(--services-primary) 20%, transparent);
}

body[data-page='services'] .services-tags {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

body[data-page='services'] .tag {
    background: var(--services-surface);
    border: 1px solid var(--services-border);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    color: var(--services-muted);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

body[data-page='services'] .tag:hover {
    transform: translateY(-2px);
    border-color: var(--services-primary);
    color: var(--services-primary);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

/* =========================================
   Services Grid Section (BG: Color/Gray)
   ========================================= */

body[data-page='services'] .services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: -5rem; /* Increased overlap slightly */
    position: relative;
    z-index: 2;
    padding-bottom: 4rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

body[data-page='services'] .service-card {
    background: var(--services-surface);
    border-radius: 24px;
    padding: 2.5rem;
    border: 1px solid var(--services-border);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.05);
    height: 100%;
}

body[data-page='services'] .service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--services-primary), var(--services-secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

body[data-page='services'] .service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.12);
    border-color: var(--services-border); /* Keep border subtle */
}

body[data-page='services'] .service-card:hover::before {
    opacity: 1;
}

body[data-page='services'] .service-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in oklab, var(--services-primary) 8%, transparent);
    border-radius: 16px;
    transition: transform 0.3s ease;
}

body[data-page='services'] .service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
    background: color-mix(in oklab, var(--services-primary) 15%, transparent);
}

body[data-page='services'] .service-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--services-text);
}

body[data-page='services'] .service-desc {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--services-muted);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

body[data-page='services'] .service-meta {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: auto;
}

body[data-page='services'] .service-meta .badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.8rem;
    background: var(--services-bg);
    color: var(--services-text);
    border-radius: 99px;
    font-weight: 600;
    border: 1px solid var(--services-border);
}

/* =========================================
   Process Section (BG: Animated)
   ========================================= */

@keyframes mesh-drift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes blob-float {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

body[data-page='services'] .process-section {
    background: transparent;
    padding-top: 8rem;
    padding-bottom: 8rem;
    position: relative;
    overflow: hidden;
}

/* Animated Gradient Background Layer */
body[data-page='services'] .process-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, 
        var(--services-surface) 0%, 
        color-mix(in oklab, var(--services-bg) 90%, var(--services-primary)) 50%, 
        var(--services-surface) 100%);
    background-size: 200% 200%;
    animation: mesh-drift 15s ease infinite;
    z-index: -2;
}

/* Floating Blobs Layer */
body[data-page='services'] .process-section::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 50% 50%, color-mix(in oklab, var(--services-primary) 5%, transparent), transparent 50%),
        radial-gradient(circle at 80% 20%, color-mix(in oklab, var(--services-secondary) 5%, transparent), transparent 40%);
    animation: blob-float 20s ease-in-out infinite alternate;
    z-index: -1;
    pointer-events: none;
}

body[data-page='services'] .section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem;
    padding: 0 24px;
    position: relative;
    z-index: 2;
}

body[data-page='services'] .section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--services-text);
    letter-spacing: -0.02em;
}

body[data-page='services'] .section-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--services-muted);
}

body[data-page='services'] .process-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 0 24px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Redesigned Process Card Design */
body[data-page='services'] .step-card {
    background: var(--services-surface);
    border-radius: 32px;
    overflow: hidden;
    border: 1px solid var(--services-border);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.08);
    height: 100%;
}

body[data-page='services'] .step-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 30px 60px -15px rgba(0,0,0,0.18);
    border-color: var(--services-primary);
}

body[data-page='services'] .step-image {
    width: 100%;
    height: 280px; /* Taller image */
    position: relative;
    overflow: hidden;
}

body[data-page='services'] .step-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent 50%);
    z-index: 1;
}

body[data-page='services'] .step-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

body[data-page='services'] .step-card:hover .step-image img {
    transform: scale(1.15);
}

/* Updated Step Number Style */
body[data-page='services'] .step-number {
    position: absolute;
    bottom: -30px; /* Overlaps image and text */
    right: 30px;
    left: auto;
    top: auto;
    background: linear-gradient(135deg, var(--services-primary), var(--services-secondary));
    color: white;
    font-weight: 900;
    font-size: 1.5rem;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    z-index: 5;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
    border: 4px solid var(--services-surface);
    transform: rotate(-5deg);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(4px); /* Glass effect attempt, though bg is opaque */
}

body[data-page='services'] .step-card:hover .step-number {
    transform: rotate(0deg) scale(1.15);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.6);
    background: linear-gradient(135deg, var(--services-secondary), var(--services-primary)); /* Swap gradient */
}

/* Dark mode adjustment for step number border */
:root.theme-dark body[data-page='services'] .step-number {
    border-color: var(--services-surface);
}

body[data-page='services'] .step-body {
    padding: 3.5rem 2rem 2.5rem 2rem; /* More top padding to clear the number */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    position: relative;
    text-align: center;
}

body[data-page='services'] .step-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--services-text);
    line-height: 1.2;
    transition: color 0.3s ease;
}

body[data-page='services'] .step-card:hover .step-title {
    color: var(--services-primary);
}

body[data-page='services'] .step-desc {
    font-size: 1.1rem;
    color: var(--services-muted);
    line-height: 1.7;
    margin-bottom: 0;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    body[data-page='services'] .services-grid {
        gap: 1.5rem;
        margin-top: -2rem;
        padding-left: 16px;
        padding-right: 16px;
    }
    
    body[data-page='services'] .process-steps {
        gap: 2rem;
        padding: 0 16px;
    }
    
    body[data-page='services'] .services-hero {
        padding-top: 7rem;
        padding-bottom: 4rem;
    }
    
    body[data-page='services'] .services-title {
        font-size: 2.5rem;
    }
}

/* =========================================
   Industries Section (BG: Color/Gray)
   ========================================= */

body[data-page='services'] .industries-section {
    background: var(--services-bg);
}

body[data-page='services'] .industries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

body[data-page='services'] .industry-card {
    background: var(--services-surface);
    padding: 2.5rem 1.5rem;
    border-radius: 20px;
    text-align: center;
    border: 1px solid var(--services-border);
    transition: all 0.3s ease;
}

body[data-page='services'] .industry-card:hover {
    transform: translateY(-5px);
    border-color: var(--services-primary);
    box-shadow: 0 15px 30px -5px rgba(0,0,0,0.05);
}

body[data-page='services'] .industry-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: inline-block;
}

body[data-page='services'] .industry-title {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--services-text);
}

/* =========================================
   CTA Section
   ========================================= */

body[data-page='services'] .services-cta {
    padding: 6rem 2rem;
    background: transparent; /* Let container bg handle it or remove section padding if needed */
    display: flex;
    justify-content: center;
}

body[data-page='services'] .services-cta-card {
    background: linear-gradient(135deg, var(--services-primary) 0%, #0284c7 50%, var(--services-secondary) 100%);
    border-radius: 40px;
    padding: 6rem 3rem;
    text-align: center;
    color: white;
    max-width: 1000px;
    width: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 30px 60px -15px rgba(14, 165, 233, 0.4), 
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    isolation: isolate;
}

/* Decorative Background Elements */
body[data-page='services'] .services-cta-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: rotate-bg 20s linear infinite;
    z-index: -1;
}

body[data-page='services'] .services-cta-card::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(40px);
    z-index: -1;
}

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

body[data-page='services'] .cta-icon {
    font-size: 4.5rem;
    margin-bottom: 2rem;
    display: inline-block;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
    animation: float-icon 3s ease-in-out infinite alternate;
}

@keyframes float-icon {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

body[data-page='services'] .cta-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: white;
    position: relative;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

body[data-page='services'] .cta-desc {
    font-size: 1.25rem;
    margin-bottom: 3.5rem;
    opacity: 0.95;
    color: rgba(255, 255, 255, 0.9);
    position: relative;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

body[data-page='services'] .services-cta-card .btn {
    background: white;
    color: var(--services-primary);
    padding: 1.2rem 3.5rem;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    display: inline-block;
    text-decoration: none;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

body[data-page='services'] .services-cta-card .btn:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.3);
    background: white;
}

/* =========================================
   Responsive Adjustments
   ========================================= */

@media (max-width: 1024px) {
    /* Auto-fit handles grids, so specific column counts are removed */
}

@media (max-width: 768px) {
    body[data-page='services'] section {
        padding: 4rem 1.5rem;
    }

    body[data-page='services'] .services-hero {
        padding-top: 7rem;
        padding-bottom: 4rem;
    }
    
    body[data-page='services'] .services-title {
        font-size: 2.25rem;
    }
    
    body[data-page='services'] .services-grid {
        gap: 1.5rem;
        margin-top: -2rem;
        padding-left: 16px;
        padding-right: 16px;
    }
    
    body[data-page='services'] .process-steps {
        gap: 1.5rem;
        padding: 0 16px;
    }

    body[data-page='services'] .services-cta-card {
        padding: 3rem 1.5rem;
        border-radius: 24px;
    }

    body[data-page='services'] .cta-title {
        font-size: 2rem;
    }

    body[data-page='services'] .cta-desc {
        font-size: 1.1rem;
    }
}
