/* General Reset & Box-Sizing */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: #333; /* Dark gray for main text */
    background-color: #F8F9FA; /* Light background */
    display: flex;
    justify-content: center;
    min-height: 100vh;
    position: relative; /* Needed for background-overlay */
    overflow-x: hidden; /* Prevent horizontal scroll */
    scroll-behavior: smooth; /* For smooth scrolling to sections */
}

/* Background Image and Overlay */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/hospital_background.jpg'); /* Your hospital background image */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.5; /* Subtle effect */
    z-index: -1; /* Place behind content */
}

.container {
    max-width: 1200px; /* Wider container for this site */
    width: 100%;
    background-color: rgba(212, 209, 209, 0.4); /* White content background with 90% opacity */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background-color: #FFFFFF; /* White header background */
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #E0E0E0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);

    /* Sticky Header Properties */
    position: fixed;
    top: 0;
    left: 50%; /* Center the header */
    transform: translateX(-50%); /* Adjust for centering */
    width: 100%;
    max-width: 1200px; /* Match container width */
    z-index: 1000; /* Ensure it stays on top */
    /* Smooth transitions for changes in background, padding, and shadow */
    transition: background-color 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
}

.top-contact {
    display: flex;
    justify-content: center;
    gap: 25px;
    font-size: 0.9em;
    color: #555;
    margin-bottom: 15px;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    /* Transitions for hiding/showing top contact info */
    transition: margin-bottom 0.3s ease, opacity 0.3s ease, height 0.3s ease;
    overflow: hidden; /* Hide overflow during transition */
    height: auto; /* Default height */
    opacity: 1; /* Default opacity */
}

.top-contact p {
    display: flex;
    align-items: center;
}

.top-contact i {
    color: #003366; /* Dark blue from logo */
    margin-right: 8px;
}

.top-contact a {
    color: #003366;
    text-decoration: none;
    transition: color 0.3s ease;
}

.top-contact a:hover {
    color: #CC0000; /* Red from logo */
}

.header-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Transitions for layout changes */
    transition: flex-direction 0.3s ease, justify-content 0.3s ease, align-items 0.3s ease;
}

.logo {
    max-width: 250px; /* Adjust logo size as needed */
    height: auto;
    margin-bottom: 20px;
    /* Transitions for logo size and margin */
    transition: max-width 0.3s ease, margin-bottom 0.3s ease;
}

.main-nav {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    /* Transition for navigation gap */
    transition: gap 0.3s ease;
}

.main-nav .nav-link {
    color: #003366; /* Dark blue from logo */
    text-decoration: none;
    font-weight: 600;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.main-nav .nav-link:hover {
    background-color: #F0F8FF; /* Light blue hover */
    color: #CC0000; /* Red hover */
}

/* Scrolled Header State */
.header.scrolled-header {
    background-color: rgba(255, 255, 255, 0.9); /* Transparent white background */
    padding: 10px 20px; /* Reduced padding */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* More prominent shadow */
}

.header.scrolled-header .top-contact {
    margin-bottom: 0;
    height: 0; /* Collapse height to hide */
    opacity: 0; /* Fade out */
    pointer-events: none; /* Disable interactions when hidden */
}

.header.scrolled-header .header-main {
    flex-direction: row; /* Horizontal layout for logo and nav */
    justify-content: space-between; /* Logo left, nav right */
    align-items: center;
}

.header.scrolled-header .logo {
    max-width: 150px; /* Smaller logo */
    margin-bottom: 0; /* Remove bottom margin */
}

.header.scrolled-header .main-nav {
    gap: 15px; /* Smaller gap for nav links */
}

/* Main Content Sections */
.main-content {
    flex-grow: 1;
    /* The top padding is now controlled by JavaScript to dynamically adjust for the sticky header. */
    /* We set the other padding values explicitly to avoid conflicts with the dynamic top padding. */
    padding-right: 20px;
    padding-bottom: 40px;
    padding-left: 20px;
    transition: padding-top 0.3s ease; /* Smooth transition for padding changes */
}

section {
    padding: 60px 0;
    margin-bottom: 40px;
    border-bottom: 1px solid #F0F0F0; /* Light separator */
}

section:last-of-type {
    border-bottom: none; /* No border for the last section */
}

h1, h2 {
    font-family: 'Roboto', sans-serif;
    color: #003366; /* Dark blue from logo */
    text-align: center;
    margin-bottom: 30px;
    font-weight: 700;
}

h1 {
    font-size: 2.8em;
}

h2 {
    font-size: 2.2em;
}

p {
    font-size: 1.05em;
    line-height: 1.7;
    color: #555;
    margin-bottom: 15px;
}

/* Hero Section */
.hero-section {
    background-color: #fff; /* Very light blue background */
    padding: 80px 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 60px;
}

.hero-content h1 {
    font-size: 3.5em;
    margin-bottom: 20px;
    color: #003366;
}

.hero-content p {
    font-size: 1.3em;
    max-width: 700px;
    margin: 0 auto 30px;
    color: #444;
}

/* About Us Section */
.about-section .about-content p {
    max-width: 800px;
    margin: 0 auto 15px auto;
    text-align: justify;
}

/* Forms Section */
.forms-section {
    text-align: center;
}

.forms-intro {
    max-width: 700px;
    margin: 0 auto 40px;
    color: #555;
}

.form-icons-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 30px;
}

.form-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #003366;
    font-weight: 600;
    font-size: 1.1em;
    transition: color 0.3s ease, transform 0.3s ease;
}

.form-icon-item i {
    font-size: 4em;
    margin-bottom: 15px;
    color: #CC0000; /* Red icon color */
    transition: color 0.3s ease;
}

.form-icon-item:hover {
    color: #CC0000;
    transform: translateY(-5px);
}

.form-icon-item:hover i {
    color: #003366; /* Dark blue on hover */
}

.forms-note {
    font-size: 0.9em;
    color: #777;
    margin-top: 40px;
}

/* Contact Section */
.contact-section {
    text-align: center;
    background-color: #dcf3f8; /* Light blue background */
    padding: 60px 20px;
    border-radius: 8px;
    margin-bottom: 0; /* No bottom margin for last section */
}

.contact-intro {
    max-width: 700px;
    margin: 0 auto 40px;
    color: #555;
}

.contact-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
}

.contact-info-block {
    flex: 1;
    min-width: 280px;
    text-align: left;
    padding: 20px;
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.contact-info-block h3 {
    font-family: 'Roboto', sans-serif;
    font-size: 1.5em;
    color: #003366;
    margin-bottom: 20px;
    text-align: left;
}

.contact-info-block p {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    color: #555;
}

.contact-info-block i {
    color: #CC0000;
    margin-right: 10px;
    font-size: 1.1em;
}

.contact-info-block a {
    color: #003366;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-info-block a:hover {
    color: #CC0000;
}

.contact-form-block {
    flex: 2;
    min-width: 300px;
    max-width: 500px;
    text-align: left;
    padding: 30px;
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.form-label {
    display: block;
    font-size: 0.95em;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.input-field {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #CCC;
    border-radius: 5px;
    font-size: 1em;
    color: #333;
    background-color: #FFF;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: #007BFF;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.space-y-4 > *:not(:last-child) {
    margin-bottom: 1rem; /* Equivalent to Tailwind's space-y-4 */
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #007BFF; /* Primary blue for button */
    color: #FFFFFF;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.3s ease;
    border: none; /* Ensure no default button border */
    width: auto; /* Override 100% width from other buttons if needed */
}

.btn:hover {
    background-color: #0056B3;
    transform: translateY(-2px);
}

.ml-2 {
    margin-left: 0.5rem;
}

.form-status {
    text-align: center;
    font-size: 0.9em;
    font-weight: 600;
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
}

.status-success {
    color: #28A745; /* Green for success */
    background-color: #D4EDDA;
    border: 1px solid #28A745;
}

.status-error {
    color: #DC3545; /* Red for error */
    background-color: #F8D7DA;
    border: 1px solid #DC3545;
}


/* Footer Styles */
.footer {
    background-color: #003366; /* Dark blue from logo */
    color: #FFFFFF; /* Changed to white for better visibility */
    padding: 30px 20px;
    text-align: center;
    font-size: 0.9em;
    margin-top: auto; /* Push footer to bottom */
}

/* Explicitly target paragraphs within footer for white color */
.footer p {
    color: #FFFFFF;
}

.footer-contact {
    margin-top: 15px;
    line-height: 1.8;
}

.footer-contact a {
    color: #FFFFFF; /* Changed to white for better visibility */
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-contact a:hover {
    color: #CC0000; /* Red from logo */
}


/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
    }

    .top-contact {
        flex-direction: column;
        gap: 10px;
    }

    .header-main {
        padding-top: 20px;
    }

    .main-nav {
        flex-direction: column; /* Keep vertical stack for mobile nav when not scrolled */
        gap: 10px;
        margin-top: 20px;
    }

    .main-nav .nav-link {
        width: 80%;
        margin: 0 auto;
    }

    h1 {
        font-size: 2.2em;
    }

    h2 {
        font-size: 1.8em;
    }

    .hero-section {
        padding: 60px 15px;
    }

    .hero-content h1 {
        font-size: 2.5em;
    }

    .hero-content p {
        font-size: 1.1em;
    }

    .about-section .about-content p {
        text-align: left; /* Align text left on small screens */
    }

    .form-icons-grid {
        grid-template-columns: 1fr; /* Stack icons */
        gap: 20px;
    }

    .contact-grid {
        flex-direction: column;
        gap: 30px;
    }

    .contact-info-block, .contact-form-block {
        min-width: unset;
        width: 100%;
    }

    .btn {
        width: 100%;
    }

    /* Scrolled Header State on Mobile */
    .header.scrolled-header {
        padding: 10px 15px; /* Even less padding on mobile when scrolled */
    }

    .header.scrolled-header .header-main {
        flex-direction: row; /* Try horizontal for logo and nav container */
        justify-content: space-between;
        align-items: center;
        padding-top: 0; /* Remove extra padding */
    }

    .header.scrolled-header .logo {
        max-width: 100px; /* Smaller logo on mobile when scrolled */
        margin-bottom: 0;
    }

    .header.scrolled-header .main-nav {
        flex-direction: row; /* Attempt horizontal menu on mobile when scrolled */
        flex-wrap: wrap; /* Allow wrapping if too many links */
        margin-top: 0; /* Remove extra margin */
        gap: 8px; /* Smaller gap for mobile nav links */
        justify-content: flex-end; /* Align links to the right */
    }
    .header.scrolled-header .main-nav .nav-link {
        width: auto; /* Allow links to shrink */
        padding: 5px 8px; /* Smaller padding for links */
        font-size: 0.85em; /* Smaller font size */
    }
}
