/* Services Section Styles */
.services {
    padding: 2rem 0;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

.services .container {
    padding: 1rem 0;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Prevent the services grid from causing a scrollbar when cards scale on hover */
.services-grid {
    overflow: hidden;
}

/* Service Card Styles */
.service-card {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-image: linear-gradient(45deg, var(--color-secondary-dark), var(--color-secondary-light)) 1;
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.3s ease, border 0.3s ease, filter 0.3s ease;
    filter: brightness(0.98);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative; /* Ensure z-index works */
}

.service-card:hover {
    transform: scale(1.02);
    border: 2px solid transparent;
    border-image: linear-gradient(45deg, var(--color-accent), var(--color-secondary-light)) 1;
    filter: brightness(1.05);
    z-index: 10; /* Bring hovered card to the front */
}

.service-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.service-card:hover .service-image {
    transform: scale(1.03);
}

/* Ensure service card titles are clear and prominent */
.service-card h3 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    color: var(--color-secondary);
    text-align: center;
}

.service-card p {
    margin-bottom: 1.5rem;
    color: var(--color-text-light);
    flex-grow: 1; /* Allow text to push button to bottom */
}

/* Learn More Button */
.btn-learn-more {
    background: linear-gradient(135deg, var(--color-secondary), var(--color-secondary-dark));
    color: var(--color-white);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    margin-top: auto; /* Push button to bottom of card */
    align-self: flex-start; /* Align button to left */
}

.btn-learn-more:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.25);
}

/* Service Section Header */
.services h2 {
    position: relative;
    margin-bottom: 2rem;
}

/* Service Detail Modal Styles */
.service-detail {
    padding: 1rem 0;
    overflow-x: hidden;
}

.service-hero {
    margin-bottom: 2rem;
    border-radius: 8px;
    overflow: hidden;
}

.service-hero img {
    width: 100%;
    border-radius: 8px;
    display: block;
}

.service-intro {
    margin-bottom: 2rem;
}

.service-intro p {
    line-height: 1.6;
}

.service-process h3, 
.service-ideal h3 {
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

/* Service Applications List */
.service-applications {
    list-style-type: none;
    padding-left: 0;
    margin: 1.5rem 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem 1rem;
}

.service-applications li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.75rem;
}

.service-applications li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-accent);
}

/* Service CTA Section */
.service-cta {
    background: linear-gradient(135deg, var(--color-secondary-dark), var(--color-secondary));
    padding: 2rem;
    border-radius: 12px;
    margin-top: 3rem;
    border-left: 4px solid var(--color-accent);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    color: #ffffff;
}

.service-cta::before {
    content: none;
}

.service-cta p {
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
    font-size: 1.1rem;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.01em;
}

.service-cta .btn-primary {
    position: relative;
    z-index: 1;
    background-color: #ffffff;
    color: var(--color-secondary-dark);
    font-weight: 600;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.service-cta .btn-primary:hover {
    background-color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Style the Perfect For list in service modals */
.service-ideal ul.service-applications {
    list-style-type: none;
    padding-left: 0;
}

.service-ideal ul.service-applications li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.5rem;
}

.service-ideal ul.service-applications li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-accent);
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
    /* Services section adjustments */
    .service-card {
        padding: 2rem;
        max-width: 100%;
    }
    
    .service-image {
        height: 200px;
    }
    
    .service-applications {
        padding-left: 0;
        grid-template-columns: 1fr;
    }
    
    .service-hero img {
        height: auto;
        border-radius: 6px;
    }
    
    .service-intro p,
    .service-process p {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    /* Improve service modal content */
    .service-process-steps {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .service-process-step {
        width: 100%;
        margin-bottom: 1.5rem;
    }
    
    /* Modal improvements for mobile */
    .modal-content {
        padding: 1.5rem;
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .service-cta {
        padding: 1.5rem;
        margin-top: 2rem;
    }
    
    .service-cta p {
        font-size: 1rem;
    }
    
    /* Reduce animation intensity for better mobile performance */
    .service-card {
        transition: transform 0.2s ease, border 0.2s ease, filter 0.2s ease;
    }
    
    .service-card:hover {
        transform: scale(1.01);
    }
    
    .service-card:hover .service-image {
        transform: scale(1.01);
    }
    
    .btn-learn-more:hover {
        transform: translateY(-2px);
    }
}

@media (max-width: 480px) {
    .service-card {
        padding: 1rem;
    }
    
    .service-card h3 {
        font-size: 1.3rem;
    }
    
    .service-card p {
        font-size: 0.9rem;
    }
    
    .service-image {
        height: 180px;
    }
    
    .service-hero {
        margin-bottom: 1.5rem;
    }
    
    .service-applications li {
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
    }
    
    .service-cta {
        padding: 1.2rem;
    }
    
    .service-cta .btn-primary {
        width: 100%;
        text-align: center;
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }
    
    .service-detail {
        padding: 0.5rem 0;
    }
    
    .modal-content {
        padding: 1rem;
    }
    
    .modal-header h3 {
        font-size: 1.4rem;
    }
    
    /* Disable hover animations on small screens */
    .service-card:hover {
        transform: none;
    }
    
    .service-card:hover .service-image {
        transform: none;
    }
    
    .btn-learn-more:hover {
        transform: none;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    }
}
