/* Global Styles */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(to bottom right, #ececec, #d4f3ff);
    color: #333;
}

header {
    display: flex;
    flex-wrap: wrap; /* Allows elements to stack on smaller screens */
    align-items: center;
    justify-content: center; /* Center elements horizontally */
    padding: 20px;
    background-color: #007bff;
    color: white;
    position: relative;
    text-align: center;
}

.page-title {
    text-align: center;
    background: linear-gradient(to bottom right, #ececec, #d4f3ff);
    color:#007bff;
    padding: 5px;
}

.logo-container {
    display: flex;
    justify-content: center; /* Center horizontally */
    align-items: center;
    width: 100%; /* Full width to center logo */
    margin-bottom: 10px;
}

.logo {
    height: auto;
    max-height: 80px; /* Adjust for mobile */
    width: auto;
}

/* Mobile-Friendly Adjustments */
@media (max-width: 768px) {
    .header {
        flex-direction: column; /* Stack logo and text vertically */
        align-items: center;    /* Center items horizontally */
    }

    .logo-container {
        margin: 10px 0;         /* Equal spacing above and below */
    }

    .header-content {
        text-align: center;
        width: 100%;
        margin-top: 5px;
    }
}

.header-content {
    text-align: center;
    flex-grow: 1;
    width: 100%; /* Makes it take full width so content centers nicely */
}

.header-content p {
    white-space: normal; /* Allows wrapping */
    word-break: break-word; /* Prevents overflow on long words/URLs */
}

footer {
    text-align: center;
    padding: 10px;
    background-color: #f1f1f1;
    color: #333;
}

.navbar {
    background-color: #0056b3; /* Dark blue background */
    color: white;
    padding: 10px;
    position: sticky;
    top: 0;
    z-index: 1000; /* Keep it above other content */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.navbar ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 10px;
    overflow-x: auto;         /* Enables horizontal scroll */
    white-space: nowrap;      /* Prevents wrapping */
    -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
    flex-wrap: wrap; /* Allows menu items to stack if needed */
    justify-content: center;
}

.navbar ul::-webkit-scrollbar {
    display: none;
}


.navbar ul li {
    margin: 0;
    font-size: 1rem;
}

.navbar ul li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease, text-decoration 0.3s;
}

.navbar ul li a:hover {
    color: #d4f3ff; /* Light blue hover effect */
    text-decoration: underline; /* Hover underline */
}

.navbar ul li a.active {
    color: #d4f3ff; /* Highlight color for active link */
    text-decoration: underline;
    font-weight: bolder;
}

@media (max-width: 768px) {
    .navbar ul {
        justify-content: flex-start; /* Align items left when scrollable */
        padding: 0 10px; /* Add side padding */
    }
}

/* Cards and Grid */
.ad-banner {
    margin: 20px auto;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Fixed three columns */
    gap: 20px; /* Space between cards */
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    padding: 20px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.card h2 {
    color: #007bff;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.card p {
    font-size: 1rem;
    color: #555;
}

/* Image styling for the card icon */
.card-icon {
    display: block;
    margin: 0 auto 10px auto;
    width: 80px;
    height: 80px;
    object-fit: contain; /* Use 'cover' if you prefer the image to fill the box and crop any overflow */
  }  

/* Responsive Design */
@media (max-width: 768px) {
    .card-container {
        grid-template-columns: repeat(1, 1fr); /* Stacks cards on smaller screens */
    }
}

/* Mortgage Calculator Styles */
.calculator {
    max-width: 600px;
    margin: 30px auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.label {
    display: block;
    margin-top: 10px;
    font-size: 1rem;
    font-weight: bold;
}

.input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.result-box {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
    text-align: center;
    font-size: 1.2rem;
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .calculator {
        width: 100%;
        margin: 20px;
    }
}

footer {
    background-color: #f1f1f1; /* Light grey background */
    color: #333; /* Text color */
    padding: 10px 20px; /* Reduce padding for compactness */
    text-align: center;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
    height: 80px; /* Compact height */
    box-sizing: border-box; /* Include padding in the height calculation */
    overflow: hidden; /* Prevent content overflow */
    font-size: 0.9rem; /* Adjust font size for smaller footer */
}

/* Footer Container Styling */
.footer-container {
    display: flex; /* Use flexbox for alignment */
    flex-wrap: wrap; /* Wrap elements for smaller screens */
    justify-content: center; /* Center content horizontally */
    gap: 10px; /* Reduce space between sections */
    max-width: 1200px;
    margin: 0 auto;
}

/* Ensure the body spans the full viewport height */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Full height of the browser window */
    margin: 0; /* Remove default margins */
    padding: 0;
}

/* Main content flexibly fills the space above the footer */
main {
    flex: 1; /* Allows the main content to grow/shrink and fill the page */
}

/* Footer stays at the bottom */
footer {
    background-color: #f1f1f1; /* Light grey background */
    color: #333; /* Text color */
    text-align: center;
    padding: 10px 20px; /* Adjust padding */
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
    box-sizing: border-box;
    height: 80px; /* Fixed height */
    margin-top: auto; /* Push the footer to the bottom */
}