/* Services Page Styles */

/* Services Content Section */
.services-content-section {
    background: #FFFFFF;
    padding: 100px 0 60px;
}

.services-header {
    margin-bottom: 78px;
}

.services-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 42px;
    line-height: 51px;
    letter-spacing: 0.04em;
    color: #1C1C1C;
    margin-bottom: 22px;
}

.services-description {
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 38px;
    letter-spacing: 0.04em;
    color: #1C1C1C;
    max-width: 1357px;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.service-box {
    background: #FFFFFF;
    border: 0.820732px solid #1C1C1C;
    padding: 46px 22px;
    min-height: 410px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: all 0.3s ease;
    position: relative;
    background-size: cover;
    background-position: center;
}

.service-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.service-box:first-child {
    border-radius: 12.311px 0 0 12.311px;
    border-right: none;
}

.service-box:first-child::before {
    border-radius: 12.311px 0 0 12.311px;
}

.service-box:nth-child(2),
.service-box:nth-child(3) {
    border-right: none;
}

.service-box:last-child {
    border-radius: 0 12.311px 12.311px 0;
}

.service-box:last-child::before {
    border-radius: 0 12.311px 12.311px 0;
}

/* Background images for each service on hover */
.service-box:nth-child(1)::before {
    background-position: 25% 50%;
    opacity: 10%;
    background-image: url("/static/images/application_and_development_backdrop.0c053bdee7dd.png");
}

.service-box:nth-child(2)::before {
    background-position: 90% 50%;
    background-image: url("/static/images/data_and_ai_backdrop.33bcd9ae5712.png");
    opacity: 10%;
}

.service-box:nth-child(3)::before {
    background-position: 40% 50%;
    background-image: url("/static/images/embedded_systems_backdrop.d18c8b7a8190.png");
    opacity: 10%;
}

.service-box:nth-child(4)::before {
    background-position: 0% 50%;
    background-image: url("/static/images/research_and_design_backdrop.14a40d712ac1.png");
    opacity: 10%;
}

.service-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(28, 28, 28, 0.3);
}

.service-box:hover::before {
    opacity: 80%;
    filter: brightness(0.7);
}

/* Make text and icons white on hover */
.service-box:hover .service-title,
.service-box:hover .service-text {
    color: #FFFFFF;
}

.service-box:hover .service-icon {
    filter: brightness(0) invert(1);
}

.service-icon-wrapper {
    width: 83px;
    height: 73px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.service-icon {
    width: 82px;
    height: 73px;
    object-fit: contain;
    transition: filter 0.3s ease;
}

.service-title {
    font-family: 'Open Sans', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1C1C1C;
    margin-bottom: 9.85px;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.service-text {
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 24px;
    letter-spacing: 0.03em;
    color: #1C1C1C;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease, font-weight 0.3s ease, opacity 0.3s ease;
    list-style: none;
    padding: 0;
    margin: 0;
    opacity: 0;
}

.service-text li {
    margin-bottom: 8px;
}

.service-text li:last-child {
    margin-bottom: 0;
}

.service-box:hover .service-text {
    font-weight: 700;
    opacity: 1;
}

/* CTA Section */
.services-cta-section {
    background: #0F467A;
    padding: 80px 0;
}

.cta-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.cta-image-area {
    width: 100%;
}

.cta-video {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

.cta-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

/* Hide mobile image on desktop */
.cta-image-mobile {
    display: none;
}

.cta-text-area {
    display: flex;
    flex-direction: column;
    gap: 35px;
}

.cta-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 44px;
    line-height: 54px;
    color: #FFFFFF;
    margin: 0;
}

.cta-highlight {
    color: #8CC5F8;
}

.cta-description {
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 38px;
    letter-spacing: 0.04em;
    color: #FFFFFF;
    margin: 0;
}

.btn-cta {
    display: inline-flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 14.8553px 21.846px;
    gap: 8.74px;
    border: 1.95263px solid #FFFFFF;
    border-radius: 29.2894px;
    background: transparent;
    font-family: 'Open Sans', sans-serif;
    font-weight: 600;
    font-size: 21.4789px;
    line-height: 29px;
    text-align: center;
    color: #FFFFFF;
    text-decoration: none;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.btn-cta:hover {
    background: #FFFFFF;
    color: #0F467A;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 1400px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .service-box:first-child {
        border-radius: 12.311px 0 0 0;
        border-right: none;
    }
    
    .service-box:first-child::before {
        border-radius: 12.311px 0 0 0 !important;
    }
    
    .service-box:nth-child(2) {
        border-radius: 0 12.311px 0 0;
        border-right: 0.820732px solid #1C1C1C;
    }
    
    .service-box:nth-child(2)::before {
        border-radius: 0 12.311px 0 0 !important;
    }
    
    .service-box:nth-child(3) {
        border-radius: 0 0 0 12.311px;
        border-right: none;
        border-top: none;
    }
    
    .service-box:nth-child(3)::before {
        border-radius: 0 0 0 12.311px !important;
    }
    
    .service-box:last-child {
        border-radius: 0 0 12.311px 0;
        border-top: none;
    }
    
    .service-box:last-child::before {
        border-radius: 0 0 12.311px 0 !important;
    }
}

@media (max-width: 992px) {
    .services-content-section {
        padding: 60px 0;
    }
    
    .services-title {
        font-size: 36px;
        line-height: 44px;
    }
    
    .services-description {
        font-size: 15px;
        line-height: 32px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .service-box {
        border-radius: 0 !important;
        border-right: 0.820732px solid #1C1C1C !important;
        border-bottom: none;
    }
    
    .service-box:first-child {
        border-radius: 12.311px 12.311px 0 0 !important;
    }
    
    .service-box:last-child {
        border-radius: 0 0 12.311px 12.311px !important;
        border-bottom: 0.820732px solid #1C1C1C;
    }
    
    .cta-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .cta-title {
        font-size: 36px;
        line-height: 44px;
    }
    
    .cta-description {
        font-size: 15px;
        line-height: 32px;
    }
}

/* Touch device optimizations - apply to all touch devices regardless of size */
@media (pointer: coarse) {
    /* Always show hover state on touch devices */
    .service-box:nth-child(1)::before,
    .service-box:nth-child(2)::before,
    .service-box:nth-child(3)::before,
    .service-box:nth-child(4)::before {
        opacity: 80% !important;
        filter: brightness(0.7) !important;
    }
    
    .service-box .service-title,
    .service-box .service-text {
        color: #FFFFFF !important;
    }
    
    .service-box .service-icon {
        filter: brightness(0) invert(1) !important;
    }
    
    .service-text {
        opacity: 1 !important;
        font-weight: 700 !important;
    }
    
    /* Disable hover animations on touch devices */
    .service-box:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    
    /* Show image instead of video on touch devices */
    .cta-video-desktop {
        display: none;
    }
    
    .cta-image-mobile {
        display: block;
    }
}

@media (max-width: 768px) {
    .services-content-section {
        padding: 40px 0;
    }
    
    .services-header {
        margin-bottom: 50px;
    }
    
    .services-title {
        font-size: 32px;
        line-height: 40px;
    }
    
    .services-description {
        font-size: 14px;
        line-height: 28px;
    }
    
    .service-box {
        padding: 30px 20px;
        min-height: auto;
    }
    
    /* Mobile: Always show hover state */
    .service-box:nth-child(1)::before {
        border-radius: 12.311px 12.311px 0 0 !important;
    }
    
    .service-box:nth-child(2)::before,
    .service-box:nth-child(3)::before {
        border-radius: 0 !important;
    }
    
    .service-box:nth-child(4)::before {
        border-radius: 0 0 12.311px 12.311px !important;
    }
    
    .services-cta-section {
        padding: 50px 0;
    }
    
    .cta-title {
        font-size: 32px;
        line-height: 40px;
    }
    
    .cta-description {
        font-size: 14px;
        line-height: 28px;
    }
    
    .btn-cta {
        font-size: 18px;
        padding: 12px 20px;
    }
}

@media (max-width: 576px) {
    .services-title {
        font-size: 28px;
        line-height: 36px;
    }
    
    .service-title {
        font-size: 14px;
    }
    
    .service-text {
        font-size: 13px;
        line-height: 22px;
    }
    
    .cta-title {
        font-size: 28px;
        line-height: 36px;
    }
}
