:root {
    --primary-navy: #002855;
    --accent-red: #D60816;
    --dark-blue: #0a1128;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-main: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    /* Healthcare Specific */
    --hc-blue-soft: #f0f7ff;
    --hc-red-soft: #fff1f2;

    /* Typography Scale */
    --fs-display: 3.5rem;
    --fs-h1: 2.5rem;
    --fs-h2: 2rem;
    --fs-h3: 1.5rem;
    --fs-h4: 1.25rem;
    --fs-h5: 1.125rem;
    --fs-h6: 1rem;
    --fs-body: 1rem;
    --fs-small: 0.875rem;
    --fs-xs: 0.75rem;

    /* Font Weights */
    --fw-normal: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
}

/* Global Styles */
body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-white);
    color: var(--text-main);
    font-size: var(--fs-body);
    font-weight: var(--fw-normal);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

img {
    max-width: 100%;
    height: auto;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--primary-navy);
    font-weight: var(--fw-bold);
    line-height: 1.3;
}

a {
    text-decoration: none;
    transition: all 0.3s ease;
}

.text-navy { color: var(--primary-navy) !important; }
.text-red { color: var(--accent-red) !important; }
.bg-navy { background-color: var(--primary-navy) !important; }
.bg-light { background-color: var(--bg-light) !important; }

/* Navbar */
.navbar {
    padding: 1rem 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    z-index: 1030; /* Ensure it stays above everything */
}

.navbar-toggler {
    border: none;
    padding: 0;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-brand img {
    height: 50px;
    width: auto;
}

.nav-link {
    font-weight: var(--fw-semibold);
    color: var(--primary-navy) !important;
    font-size: var(--fs-small);
    padding: 0.5rem 1.25rem !important;
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        background: var(--bg-white);
        padding: 1.5rem;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        margin-top: 1rem;
    }
    
    .nav-link {
        padding: 0.75rem 0 !important;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-item:last-child .nav-link {
        border-bottom: none;
    }
    
    .btn-contact {
        width: 100%;
        margin-top: 1rem;
        text-align: center;
    }
}

.nav-link:hover, .nav-link.active {
    color: var(--accent-red) !important;
}

.btn-contact {
    background-color: var(--primary-navy);
    color: var(--bg-white) !important;
    border-radius: 6px;
    font-weight: var(--fw-bold);
    padding: 0.6rem 1.5rem;
    border: none;
}

.btn-contact:hover {
    background-color: var(--accent-red);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(214, 8, 22, 0.2);
}

/* Hero Section */
.hero-wrapper {
    background-color: var(--hc-blue-soft);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex;
}

.hero-content {
    padding: 4rem 3rem;
    height: 100%;
}

.badge-outline {
    display: inline-block;
    padding: 0.4rem 1rem;
    border: 1px solid var(--primary-navy);
    border-radius: 4px;
    color: var(--primary-navy);
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    width: fit-content;
}

.display-4 {
    font-size: var(--fs-display);
    line-height: 1.1;
}

.btn-navy {
    background-color: var(--primary-navy);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 6px;
    font-weight: var(--fw-bold);
}

.btn-navy:hover {
    background-color: var(--dark-blue);
    color: white;
    transform: translateY(-2px);
}

.btn-outline-navy {
    border: 2px solid var(--primary-navy);
    color: var(--primary-navy);
    padding: 0.8rem 2rem;
    border-radius: 6px;
    font-weight: var(--fw-bold);
}

.btn-outline-navy:hover {
    background-color: var(--primary-navy);
    color: white;
}

/* Partner Slider */
.logo-slider-container {
    overflow: hidden;
    padding: 40px 0;
    position: relative;
    width: 100%;
    margin: 0;
}

.logo-track {
    display: flex;
    width: max-content;
    animation: scroll 40s linear infinite;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.logo-item {
    width: 200px;
    height: 100px;
    margin: 0 15px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    background: var(--bg-white);
}

.logo-item img {
    max-width: 100%;
    max-height: 100%;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.logo-item:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

/* Service Cards */
.service-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    height: 100%;
    transition: all 0.3s ease;
}

.service-card:hover {
    border-color: var(--primary-navy);
    box-shadow: 0 10px 30px rgba(0, 40, 85, 0.05);
    transform: translateY(-5px);
}

.service-icon {
    width: 60px;
    height: 60px;
    background: var(--hc-blue-soft);
    color: var(--primary-navy);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 767.98px) {
    .service-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
}

/* Section Spacing */
.section-padding {
    padding: 6rem 0;
}

.section-title {
    margin-bottom: 3.5rem;
}

.section-title h2 {
    font-size: var(--fs-h1);
    position: relative;
    padding-bottom: 1.5rem;
    margin-bottom: 1rem;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent-red);
    border-radius: 2px;
}

.section-title.text-start h2::after {
    left: 0;
    transform: none;
}

/* Forms */
.form-control, .form-select {
    padding: 0.8rem 1rem;
    border-color: var(--border-color);
    border-radius: 6px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-navy);
    box-shadow: 0 0 0 4px rgba(0, 40, 85, 0.05);
}

/* Footer */
footer {
    background: var(--bg-white);
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a:hover {
    color: var(--accent-red) !important;
    padding-left: 5px;
}

/* Process Steps */
.process-step {
    position: relative;
    padding: 2rem;
    background: var(--bg-white);
    border-radius: 15px;
    border: 1px solid var(--border-color);
    text-align: center;
    height: 100%;
    transition: all 0.3s ease;
}

.process-step:hover {
    border-color: var(--accent-red);
    transform: translateY(-5px);
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--primary-navy);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--fw-bold);
    font-size: 1.25rem;
    margin: 0 auto 1.5rem;
    position: relative;
    z-index: 2;
}

.process-step::after {
    content: '';
    position: absolute;
    top: 50px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--accent-red);
    z-index: 1;
}

.col-lg-4:last-child .process-step::after {
    display: none;
}

/* Specialties Image Grid */
.specialties-grid-item {
    height: 250px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.specialties-grid-item.tall {
    height: 200px;
}

@media (max-width: 767.98px) {
    .specialties-grid-item {
        height: 200px;
    }
    .specialties-grid-item.tall {
        height: 180px;
    }
}

/* Feature Cards with Images */
.feature-image-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    height: 350px;
    margin-bottom: 1.5rem;
}

.feature-image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.feature-image-card:hover img {
    transform: scale(1.1);
}

.feature-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0, 40, 85, 0.9), transparent);
    color: white;
}

/* Map Placeholder */
.map-placeholder {
    width: 100%;
    height: 400px;
    background-color: var(--hc-blue-soft);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

@media (max-width: 767.98px) {
    .map-placeholder {
        height: 250px;
    }
}

/* Parallax Effect */
.parallax-section {
    background-attachment: scroll; /* Changed to scroll to allow JS-based movement */
    background-position: center 0;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
    overflow: hidden; /* Ensure background doesn't bleed out */
}

.parallax-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 40, 85, 0.85); /* primary-navy with opacity */
    z-index: 1;
}

.parallax-overlay-light {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgb(255 255 255 / 46%); /* Brighter, cleaner white overlay */
    z-index: 1;
}

.parallax-content {
    position: relative;
    z-index: 2;
}

@media (max-width: 991.98px) {
    .parallax-section {
        background-attachment: scroll; /* Fixed backgrounds are buggy on mobile */
    }
}

/* FAQ Accordion Refined */
.custom-accordion .accordion-item {
    border: 1px solid var(--border-color) !important;
    margin-bottom: 1rem;
    border-radius: 12px !important;
    overflow: hidden;
}

.custom-accordion .accordion-button {
    background-color: var(--bg-white) !important;
    color: var(--primary-navy) !important;
    box-shadow: none !important;
    padding: 1.5rem;
}

.custom-accordion .accordion-button:not(.collapsed) {
    background-color: var(--hc-blue-soft) !important;
    color: var(--accent-red) !important;
    border-bottom: 1px solid var(--border-color);
}

.custom-accordion .accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23002855'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.custom-accordion .accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23D60816'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

/* Testimonial Slider Refined */
.testimonial-card {
    background: var(--bg-white);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.05);
    margin: 2rem 0;
    min-height: 450px; /* Fixed height to prevent layout shifts */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.testimonial-text {
    font-size: 1.15rem;
    font-style: italic;
    color: var(--text-main);
    line-height: 1.8;
    position: relative;
    margin-bottom: 2rem;
}

.testimonial-text::before {
    content: '“';
    font-size: 5rem;
    color: var(--accent-red);
    opacity: 0.2;
    position: absolute;
    top: -2rem;
    left: -1rem;
}

.testimonial-author img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--hc-blue-soft);
}

/* Fade-in Animation Classes */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 767.98px) {
    .reveal {
        transition: all 0.5s ease; /* Faster transition on mobile */
        transform: translateY(15px); /* Smaller movement on mobile */
    }
}

/* Modern Hover Effects */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    will-change: transform;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 40, 85, 0.12) !important;
}

/* Ensure images inside rounded containers are also rounded */
.rounded-4 img {
    border-radius: inherit;
}

/* Counter Style for Stats */
.counter-item h2 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, var(--primary-navy), var(--accent-red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.preloader-hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid var(--hc-blue-soft);
    border-bottom-color: var(--primary-navy);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

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

/* Modal Styles */
.modal-content {
    background-color: var(--bg-white);
}

.success-icon-wrapper {
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Scroll to Top */
#scrollToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-navy);
    color: #fff;
    border: none;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#scrollToTop:hover {
    background: var(--accent-red);
    transform: translateY(-3px);
}

/* --- Responsive Adjustments --- */

/* Tablet and below (max-width: 991.98px) */
@media (max-width: 991.98px) {
    :root {
        --fs-display: 2.75rem;
        --fs-h1: 2.25rem;
        --fs-h2: 1.75rem;
    }

    .section-padding {
        padding: 4rem 0;
    }

    .hero-content {
        padding: 3rem 2rem;
        text-align: center;
    }

    .hero-content .d-flex {
        justify-content: center;
    }

    .section-title {
        margin-bottom: 2.5rem;
    }

    .section-title.text-start {
        text-align: center !important;
    }

    .section-title.text-start h2::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .process-step::after {
        display: none;
    }

    .testimonial-card {
        padding: 2rem;
        min-height: auto;
    }
}

/* Mobile Devices (max-width: 767.98px) */
@media (max-width: 767.98px) {
    :root {
        --fs-display: 2.25rem;
        --fs-h1: 2rem;
        --fs-h2: 1.5rem;
        --fs-h3: 1.25rem;
    }

    .navbar-brand img {
        height: 40px;
    }

    .section-padding {
        padding: 3.5rem 0;
    }

    .hero-content {
        padding: 2.5rem 1.25rem;
    }

    .hero-content .d-flex {
        flex-direction: column;
        gap: 1rem !important;
    }

    .hero-content .btn {
        width: 100%;
    }

    .service-card {
        padding: 1.5rem;
    }

    .feature-image-card {
        height: 280px;
    }

    .counter-item h2 {
        font-size: 2.5rem;
    }

    .testimonial-text {
        font-size: 1rem;
    }

    .testimonial-text::before {
        font-size: 3rem;
        top: -1.5rem;
    }

    .footer-links {
        text-align: center;
    }

    footer .text-center, 
    footer .text-lg-start {
        text-align: center !important;
    }

    .social-links {
        justify-content: center;
    }

    .success-icon-wrapper i {
        font-size: 3rem;
    }
    
    /* Fix for horizontal cards in services page on mobile */
    .service-card.flex-md-row {
        text-align: center;
    }
    
    .logo-item {
        width: 160px;
        height: 80px;
        margin: 0 15px;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    :root {
        --fs-display: 1.85rem;
        --fs-h1: 1.75rem;
    }

    .section-padding {
        padding: 3rem 0;
    }

    .badge-outline {
        font-size: 0.65rem;
        padding: 0.3rem 0.8rem;
    }
}

/* Helper for fixing potential overflows */
.container, .container-fluid {
    /* Removed overflow: hidden to prevent clipping of hover-lift animations */
}
