@import url('https://fonts.googleapis.com/css2?family=Audiowide&display=swap');

/* Root variables for dynamic circle size */
:root {
    --service-circle-size: 15vw; /* Circle size based on viewport width */
}

.services-section {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.parallax-container-service {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip: rect(0, auto, auto, 0);
    -webkit-clip-path: inset(0 0 0 0);
    clip-path: inset(0 0 0 0);
}

.parallax-background-service {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: url('../img/sg-bg4.jpeg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
}

.services-heading {
    font-family: "Audiowide", system-ui;
    font-size: 36px;
    font-weight: bold;
    color: white;
    text-align: center;
    padding: 10px 0;
    margin-top: 60px;
}

.service-circle {
    position: relative;
    width: var(--service-circle-size);
    height: var(--service-circle-size);
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
    margin-top: 15px;
    transition: transform 0.3s ease-in-out;
    box-shadow: 10px 10px 15px rgba(0, 0, 0, 0.9); /* Added shadow */
}

.service-circle:hover {
    transform: scale(1.1); /* Makes the entire circle expand */
}

.service-circle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    transition: transform 0.3s ease-in-out;
}

h5 {
    font-family: "Audiowide", sans-serif;
    font-size: 20px;
    font-weight: bold;
    margin-top: 10px;
    color: white;
    text-align: center;
}

.services-section a {
    text-decoration: none;
    color: white;
    display: block;
}

/* Background image for mobile view */
@media (min-width: 1920px) {
    
    .services-heading {
        font-family: "Audiowide", system-ui;
        font-size: 36px;
        font-weight: bold;
        color: white;
        text-align: center;
        padding: 10px 0;
        margin-top: 100px;
    }

}

/* Background image for mobile view */
@media (max-width: 767.98px) {
    :root {
        --service-circle-size: 35vw; /* Adjust circle size for smaller screens */
    }
    h5 {
        font-size: 9px; /* Adjust heading size */
    }
    .service-circle {
        width: 60%;
        height: 60%;
        margin-bottom: 30px; /* Adjust space between circles */
    }
    
    /* Mobile-specific background image with parallax */
    .parallax-background-service {
        position: fixed;
        background-image: url('../img/service-mobile-bg.png');
        height: 100vh;
        background-position: center;
        display: flex;
        flex-direction: column; /* Stack heading and content */
        align-items: center; /* Center horizontally */
        justify-content: flex-start; /* Start from the top */
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        padding-top: 20px; /* Add space at the top */
    }
}

/* Mobile view adjustments */
@media (max-width: 575.98px) {
    :root {
        --service-circle-size: 30vw; /* Slightly reduce circle size */
    }

    .services-heading {
        font-family: "Audiowide", system-ui;
        font-size: 26px;
        font-weight: bold;
        margin-bottom: 30px;
        text-align: center; /* Ensure heading is centered */
    }
    
    h5 {
        font-size: 13px !important; /* Further decrease heading size */
        margin-top: 15px !important;
    }
    
    .services-section {
        display: flex; /* Enable Flexbox */
        flex-direction: column; /* Stack content vertically */
        justify-content: center; /* Center content vertically within available space */
        align-items: center; /* Center content horizontally */
        padding: 20px; /* Adjust padding for mobile view */
        min-height: 100vh; /* Increase height for mobile view */
    }

    .service-circle {
        margin-bottom: 5px; /* Further reduce space between circle images */
    }
}



/* Larger screens adjustments */
@media (min-width: 2560px) {
    :root {
        --service-circle-size: 12vw; /* Reduce circle size slightly for larger screens */
    }
    
    .services-section {
        padding: 100px 0; /* Increase padding for larger screens */
        min-height: 100vh; /* Increase height for larger screens */
        background-attachment: fixed;
    }
    
    .services-heading {
        font-size: 48px; /* Increase font size for the heading */
        margin-bottom: 40px; /* Increase spacing below the heading */
    }
    
    .service-circle {
        margin-bottom: 40px; /* Increase spacing between service circles */
        box-shadow: 12px 12px 20px rgba(0, 0, 0, 0.9); /* Enhance shadow for larger screens */
    }
    
    h5 {
        font-size: 40px !important; /* Increase font size of text below the circles */
    }
}

/* Safari-specific fix for consistent parallax */
@media not all and (min-resolution: 0.001dpcm) {
    @supports (-webkit-touch-callout: none) {
        .services-section {
            background-attachment: fixed; /* Ensure fixed parallax on Safari */
        }
    }
}

/* iPhone-specific adjustments to ensure smooth parallax */
@media screen and (max-device-width: 812px) and (-webkit-min-device-pixel-ratio: 2) {
    .services-section {
        background-attachment: fixed; /* Maintain parallax on iPhones */
    }

    h5 {
        font-size: 1.8em; /* Adjust heading size for iPhones */
    }

    .overlay-content {
        padding: 5px;
    }
}

/* Override for iOS devices */
.is-ios .services-section {
    background-attachment: scroll;
  }
