.service-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border: none;
    border-radius: 0; /* Remove rounded corners for boxy design */
    margin: 0;
    height: 100%;
    transform: none !important; /* Remove any default transform animations */
    box-shadow: none !important;
    text-decoration: none;
}

.service-card-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    background-size: cover;
    background-position: center;
    z-index: 10;
}

.service-card:hover .service-card-image {
    opacity: 1;
}

.service-card-content {
    position: relative;
    z-index: 20;
    transition: background-color 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.service-card-content > div {
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.service-card-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.service-card-content p {
    font-size: 0.9rem;
    line-height: 1.4;
    opacity: 0.9;
}

.service-card:hover .service-card-content {
    background-color: rgba(0, 0, 0, 0.8);
}

.service-card:hover .service-card-content h3,
.service-card:hover .service-card-content p,
.service-card:hover .service-card-content span {
    color: white;
}

.service-category {
    background: white;
    color: #2563eb;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    display: inline-block;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.service-card:hover .service-category {
    background-color: rgba(59, 130, 246, 0.9);
    color: white;
}

.service-card:hover .service-learn-more {
    color: white;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
}

.service-learn-more svg {
    margin-left: 0.25rem;
    height: 1rem;
    width: 1rem;
}

.service-bg-development {
    background-image: url('https://images.unsplash.com/photo-1573496773894-10082b2f92e0?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
}

.service-bg-modernization {
    background-image: url('https://images.unsplash.com/photo-1498050108023-c5249f4df085?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
}

.service-bg-support {
    background-image: url('https://images.unsplash.com/photo-1525385133512-2f3bdd039054?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
}

.service-bg-analytics {
    background-image: url('https://images.unsplash.com/photo-1518186285589-2f7649de83e0?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
}

.service-bg-governance {
    background-image: url('https://images.unsplash.com/photo-1517048676732-d65bc937f952?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
}

.service-bg-automation {
    background-image: url('https://images.unsplash.com/photo-1485827404703-89b55fcc595e?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
}

.service-bg-cloud {
    background-image: url('https://images.unsplash.com/photo-1522199755839-a2bacb67c546?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
}

.service-bg-digital {
    background-image: url('https://images.unsplash.com/photo-1519389950473-47ba0277781c?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
}

/* Service card specific colors */
.service-bg-digital-transformation {
    background-image: url('https://images.unsplash.com/photo-1519389950473-47ba0277781c?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
}

.service-bg-automation {
    background-image: url('https://images.unsplash.com/photo-1485827404703-89b55fcc595e?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
}

.service-bg-solutions {
    background-image: url('https://images.unsplash.com/photo-1498050108023-c5249f4df085?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
}

.service-bg-data-ai {
    background-image: url('https://images.unsplash.com/photo-1518186285589-2f7649de83e0?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
}

.service-bg-infor {
    background-image: url('https://images.unsplash.com/photo-1522199755839-a2bacb67c546?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
}

/* Service card colors */
.bg-blue-darkest {
    background-color: #0a2342;
}

.bg-blue-light {
    background-color: #055292;
}

.bg-blue-medium {
    background-color: #29a9ff;
}

.bg-blue-medium-dark {
    background-color: #1a5cc6;
}

.bg-blue-dark {
    background-color: #0e2a47;
}

/* Service grid layout */
.services-grid {
    display: grid;
    grid-template-columns: [col-start] 59% [col-mid] 41% [col-end];
    grid-template-rows: [row1] 260px [row2] 240px [row3] 300px;
    gap: 0;
    max-width: 100%;
    overflow: hidden;
    border: none;
    outline: none;
}

.services-grid a {
    text-decoration: none;
    border: none;
    outline: none;
}

/* Grid area definitions for specific placement */
.digital-transformation {
    grid-column: col-start;
    grid-row: row1 / span 2;
}

.automation {
    grid-column: col-mid / col-end;
    grid-row: row1;
}

.solutions-engineering {
    grid-column: col-mid / col-end;
    grid-row: row2;
}

.data-ai {
    grid-column: col-start;
    grid-row: row3;
    height: 100%;
}

.infor-cloudsuite {
    grid-column: col-mid / col-end;
    grid-row: row3;
    height: 100%;
}

/* Font size adjustments for different tile sizes */
.tile-large .service-card-content h3 {
    font-size: 1.75rem;
}

.tile-large .service-card-content p {
    font-size: 1rem;
}

.tile-medium .service-card-content h3,
.tile-wide .service-card-content h3 {
    font-size: 1.25rem;
}

.tile-medium .service-card-content p,
.tile-wide .service-card-content p {
    font-size: 0.875rem;
}

.tile-small .service-card-content h3 {
    font-size: 1.125rem;
}

.tile-small .service-card-content p {
    font-size: 0.8125rem;
}

/* Responsive adjustments */
@media (max-width: 1280px) {
    .services-grid {
        grid-template-columns: [col-start] 5fr [col-mid] 4fr [col-end];
        grid-template-rows: [row1] 260px [row2] 240px [row3] 300px;
    }
}

@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: [col-start] 1fr [col-mid] 1fr [col-end];
        grid-template-rows: [row1] 180px [row2] 180px [row3] 220px [row4] 180px;
        gap: 1px; /* Add minimal gap to prevent overlap */
    }
    
    .digital-transformation {
        grid-column: col-start / col-end;
        grid-row: row1;
    }
    
    .automation {
        grid-column: col-start;
        grid-row: row2;
        z-index: 1; /* Ensure proper stacking */
    }
    
    .solutions-engineering {
        grid-column: col-mid;
        grid-row: row2;
    }
    
    .data-ai {
        grid-column: col-start;
        grid-row: row3;
    }
    
    .infor-cloudsuite {
        grid-column: col-mid;
        grid-row: row3;
    }
    
    .service-card-content h3 {
        font-size: 1.25rem;
    }
    
    .service-card-content p {
        font-size: 0.875rem;
    }
}

@media (max-width: 768px) {
    .services-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0;
        width: 100%;
        max-width: 100%;
    }

    .digital-transformation, 
    .automation, 
    .solutions-engineering, 
    .data-ai, 
    .infor-cloudsuite {
        position: relative;
        width: 100%;
        height: 260px;
        grid-column: 1;
        margin-bottom: 0;
    }

    .digital-transformation {
        grid-row: 1;
    }

    .automation {
        grid-row: 2;
    }

    .solutions-engineering {
        grid-row: 3;
    }

    .data-ai {
        grid-row: 4;
    }

    .infor-cloudsuite {
        grid-row: 5;
    }

    /* Adjust card content for better readability */
    .service-card-content h3 {
        font-size: 1.25rem;
        line-height: 1.3;
    }

    .service-card-content p {
        font-size: 0.875rem;
        line-height: 1.5;
        margin-bottom: 0.75rem;
    }
    
    .service-card-content > div {
        padding: 1.5rem;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
}

@media (max-width: 640px) {
    .services-grid {
        display: flex;
        flex-direction: column;
        gap: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .digital-transformation, 
    .automation, 
    .solutions-engineering, 
    .data-ai, 
    .infor-cloudsuite {
        position: relative;
        width: 100%;
        height: 280px;
        grid-column: unset;
        grid-row: unset;
        margin-bottom: 0;
    }
    
    .service-card-content h3 {
        font-size: 1.25rem;
        line-height: 1.3;
        margin-bottom: 0.75rem;
    }
    
    .service-card-content p {
        font-size: 0.875rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }
    
    .service-card-content > div {
        padding: 1.5rem;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
}

/* Mobile service tile improvements */
@media (max-width: 480px) {
    .services-grid {
        display: flex;
        flex-direction: column;
        gap: 0;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    
    .digital-transformation, 
    .automation, 
    .solutions-engineering, 
    .data-ai, 
    .infor-cloudsuite {
        position: relative;
        width: 100%;
        height: 280px;
        grid-column: unset;
        grid-row: unset;
        margin-bottom: 0;
    }
    
    /* Adjust container padding for mobile */
    #services .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Service card styling */
    .service-card {
        margin-bottom: 0;
        border-radius: 0;
        overflow: hidden;
        box-shadow: none;
        height: 100%;
    }
    
    /* Ensure proper content spacing inside cards */
    .service-card-content > div {
        padding: 1.5rem;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: 100%;
    }
    
    .service-card-content h3 {
        font-size: 1.2rem;
        line-height: 1.3;
        margin-bottom: 0.75rem;
    }
    
    .service-card-content p {
        font-size: 0.875rem;
        line-height: 1.5;
        margin-bottom: 1rem;
        flex-grow: 1;
    }
    
    /* Make learn more links more visible */
    .service-learn-more {
        margin-top: 0.75rem;
        padding-top: 0.5rem;
    }
}

/* Bottom row tile specific styles */
.data-ai .service-card-content h3,
.infor-cloudsuite .service-card-content h3 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.data-ai .service-card-content p,
.infor-cloudsuite .service-card-content p {
    font-size: 0.95rem;
    line-height: 1.5;
}

@media (max-width: 640px) {
    .data-ai .service-card-content > div,
    .infor-cloudsuite .service-card-content > div {
        padding: 1.5rem;
    }
    
    .data-ai .service-card-content h3,
    .infor-cloudsuite .service-card-content h3 {
        font-size: 1.25rem;
    }
    
    .data-ai .service-card-content .service-category,
    .infor-cloudsuite .service-card-content .service-category {
        margin-bottom: 1rem;
    }

    .data-ai .service-card-content > div,
    .infor-cloudsuite .service-card-content > div {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 2.25rem;
    }
}
