/* Global styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

body {
    line-height: 1.5;
    background-image: url('calculator-background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column; /* Ensure content stacks vertically */
    margin: 0;
    padding: 0;
}

main {
    flex-grow: 1; /* This ensures main content grows to fill available space */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centers the content vertically if needed */
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* Header Styles */
header {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px;
    padding-bottom: 80px;
    width: 100%;
    z-index: 1000;
}

.logo img {
    max-width: 400px;
    height: auto;
}

nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    margin: 0;
}

nav ul li a {
    color: #004080;
    padding: 15px;
    border-radius: 5px;
    transition: background-color 0.3s;
    text-decoration: none;
    font-size: 22px;
    width: 100%;
}

nav ul li a.current-page {
    color: #DC143C;
}

nav ul li a:hover {
    color: #DC143C;
}

/* Burger menu toggle button */
.menu-toggle {
    display: none; /* Hidden by default (only shows on smaller screens) */
    align-items: center;
    justify-content: flex-end;
    font-size: 18px; /* Adjusted size */
    color: #085eb4; /* Brand color or a more sophisticated tone */
    position: absolute;
    right: 20px;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    font-weight: bold; /* Make the label bold */
    text-transform: uppercase; /* Uppercase for a more professional feel */
    letter-spacing: 1px; /* Add slight letter spacing */
    padding: 5px 10px; /* Add some padding around the label and icon */
    background: none; /* No background */
    border: none; /* No border */
    outline: none; /* No focus outline */
    transition: color 0.3s ease, transform 0.3s ease; /* Smooth transition for effects */
}

.menu-toggle:hover,
.menu-toggle:focus {
    color: #DC143C; /* Darken color on hover for better contrast */
    transform: scale(1.05); /* Slightly enlarge on hover for emphasis */
}

/* Styling for the Menu Label */
.menu-toggle::before {
    content: "Menu";
    margin-right: 10px;
    font-size: 18px; /* Increase size of the "Menu" label */
    color: #085eb4; /* Matching the burger icon */
    color: inherit; /* Inherit color from parent (.menu-toggle) */
}

.menu-toggle:hover::before {
    color: #DC143C;
    transition: color 0.3s ease, transform 0.3s ease;
}

/* Hover effects for the icon */
.menu-toggle:hover::after {
    color: #DC143C; /* Darker color on hover */
}

/* Animation for sliding effect */
.show-menu {
    animation: slideDown 0.3s ease-out forwards;
}


@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Center the tab navigation container */
.tab-nav-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

/* Tab Navigation */
.tab-nav {
    display: inline-flex; /* Use inline-flex to wrap the background tightly around the buttons */
    background: rgba(255, 255, 255, 0.7);
    padding: 10px;
    border-radius: 10px; /* Optional: Add rounded corners */
}

/* Tab Button Styles */
.tab-button {
    background-color: #0059b3;
    color: white;
    font-size: 18px;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 0 10px;
}

.tab-button.active {
    background-color: #070050; /* Darker shade for active tab */
    color: white; /* Keep text white for contrast */
    transform: scale(1.1); /* Slight enlargement */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Add a subtle shadow */
    transition: transform 0.2s ease, background-color 0.3s ease; /* Smooth transitions */
}

.tab-button:hover {
    background-color: #004080;
}

/* Responsive: Adjust the tab buttons for smaller screens */
@media (max-width: 850px) {
    /* Reduce padding and font size for the buttons */
    .tab-button {
        font-size: 14px;
        padding: 8px 12px;
        margin: 0 5px;
    }

    .tab-button {
        margin: 5px 5px;
    }
}

/* The visible trigger of the dropdown */
.custom-dropdown-trigger {
    width: 100%; /* Full width of the parent */
    max-width: 400px; /* Limit to a reasonable size */
    background-color: #fff;
    color: #085eb4;
    font-size: 18px;
    font-weight: bold;
    padding: 10px;
    border: 2px solid #085eb4;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    justify-content: center; /* Center both label and arrow */
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

/* Arrow next to the text */
.dropdown-arrow {
    font-size: 18px;
    color: #085eb4;
    margin-left: 10px; /* Space between label and arrow */
}

/* Hidden dropdown menu (ul) */
.custom-dropdown-menu {
    display: none;
    position: absolute;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    z-index: 10;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Individual dropdown items (li) */
.custom-dropdown-menu li {
    padding: 10px;
    font-size: 18px;
    color: #0059b3;
    cursor: pointer;
    text-align: center;
}

.custom-dropdown-menu li:hover {
    background-color: #bfbfbf;
}

/* Show the dropdown menu when active */
.custom-dropdown.active .custom-dropdown-menu {
    display: block;
}

/* Centering the whole dropdown and making it responsive */
.custom-dropdown {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    margin: 0 auto; /* Center the entire dropdown */
    position: relative;
}

/* Hide original tab buttons on smaller screens */
@media (max-width: 600px) {
    .tab-nav-wrapper {
        display: none;
    }
}

/* Custom dropdown (Visible on smaller screens) */
.custom-dropdown {
    display: none; /* Hidden by default */
}

/* Show custom dropdown on screens below 600px */
@media (max-width: 600px) {
    .custom-dropdown {
        display: inline-block;
        width: 100%; /* Full width of the screen */
        margin: 0 auto; /* Center the dropdown */
    }    
}

@media (max-width: 500px) {
    .custom-dropdown {
        display: inline-block;
        width: 100%; /* Full width of the screen */
        max-width: 300px;
        margin: 0 auto; /* Center the dropdown */
    }
}

@media (max-width: 350px) {
    .custom-dropdown {
        display: inline-block;
        width: 100%; /* Full width of the screen */
        max-width: 250px;
        margin: 0 auto; /* Center the dropdown */
    }    
}

/* Hide custom dropdown on larger screens */
@media (min-width: 601px) {
    .custom-dropdown {
        display: none;
    }
}

/* Two-column layout for the main container */
#main-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    grid-gap: 20px;
    padding: 20px;
    width: 80%; 
    margin: 0 auto; 
    background-color: rgba(255, 255, 255, 0.7); 
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); 
    border-radius: 10px;
}

/* Left column */
.left-column {
    padding: 20px;
    border-radius: 10px;
}

/* Right Column */
.right-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start; /* Align content to the left (default) */
    padding: 20px;
    border-radius: 10px;
    height: 100%;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    #main-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    #main-container {
        width: 90%;
    }

    .left-column {
        padding: 0;
    }

    .right-column {
        padding: 0;
    }
}

/* Hide non-active calculator sections */
.calculator-section {
    display: none;
}

/* Show the active section */
.calculator-section.active {
    display: block;
}

.calculator-section h2 {
    color: #004080; 
    font-size: 30px;
    margin-bottom: 10px;
}

label, input, button {
    display: block;
    margin-top: 10px;
}

/* Style adjustments for dropdown */
input[type="text"], input[type="number"], select {
    width: 100%;
    padding: 8px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

button {
    margin-top: 20px;
    align-self: center;
}

form label {
    font-size: 18px;
}

.input-group {
    display: flex; 
    align-items: start;
}

.currency-symbol {
    margin-right: 10px; 
    margin-top: 10px;
    font-size: 22px; 
    font-weight: bold;
    color: #004080;
}

.calculate-button {
    display: block; /* Ensure the button is treated as a block element */
    margin: 20px auto; /* Center the button horizontally */
    padding: 10px 20px;
    background-color: #0059b3;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    border-radius: 5px;
    border: none;
}

.calculate-button:hover {
    background-color: #004080;
}

#results {
    display: none;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 20px;
    width: 100%; /* Ensure results take up full width */
    box-sizing: border-box;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Style for Disclaimer and Logo */
.disclaimer-logo-container {
    text-align: center;
    padding-top: 20px;
}

.disclaimer {
    color: #555; /* Subtle text color */
    font-size: 16px;
    margin-bottom: 20px;
}

.company-logo {
    max-width: 200px; /* Adjust the logo size */
    height: auto;
    margin: 0 auto;
}

#results h2, #results h3 {
    color: #004080;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

#results h3 {
    font-size: 20px;
    border-bottom: 2px solid #004080;
    padding-top: 10px;
}

#results h4 {
    border-bottom: 1px solid #004080;
    padding-top: 10px;
    color: #004080;
}

#results p {
    display: flex;
    justify-content: space-between; /* Distribute space between label and result */
    margin-top: 5px;
    margin-bottom: 10px; 
    line-height: 1.6; 
    color: #004080;
    padding-bottom: 10px;
    border-bottom: 1px solid #004080;
}

.results div {
    margin-bottom: 20px; 
    padding-bottom: 10px;
}

/* Prevent currency and value from splitting */
.nowrap {
    white-space: nowrap;
}

/* Prevent arrow and label from splitting */
.toggle-arrow-wrapper {
    white-space: nowrap;
    cursor: pointer;
    font-size: 16px;
    margin-left: 10px;
    color: #005bc2;
}


/* Initially hide the details content */
.details-content {
    display: none;
    margin-left: 20px; /* Optional: Add some indentation to the expanded content */
}

/* Style the toggle arrow */
.toggle-arrow {
    cursor: pointer;
    font-size: 16px;
    margin-left: 10px;
    color: #005bc2;
}

.toggle-arrow:hover {
    color: #070050;
    transform: scale(1.1);
}

/* Styling for Total Bond Costs and Total Transfer Costs */
.bold-result {
    font-size: 18px; /* Increase font size */
    font-weight: bold; /* Make text bold */
}

/* Styling for numerical results (right alignment) */
#results p span.result {
    text-align: right;
    font-size: 18px;
}

/* Ensure the container for checkboxes is aligned correctly */
#optional-costs-checkboxes {
    display: flex;
    flex-direction: column; /* Stack checkboxes vertically */
    align-items: flex-start; /* Align the checkboxes and labels to the left */
    width: 100%; /* Ensure the container takes the full width */
}

/* Style for each label and checkbox */
#optional-costs-checkboxes label {
    display: flex; 
    align-items: center; /* Align checkbox and text on the same line */
    width: 100%; /* Force each label to take up full width */
    margin-bottom: 10px; /* Add space between each checkbox */
    color: #004080;
    font-size: 16px; /* Adjust the font size */
}

/* Ensure the checkbox stays aligned with the text */
#optional-costs-checkboxes label input[type="checkbox"] {
    margin-right: 10px; /* Add space between checkbox and text */
    vertical-align: middle; /* Ensure checkbox is vertically aligned */
}

/* Custom styles for the Affordability Calculator results */
#affordability-results-container {
    padding-bottom: 0; /* Remove the padding */
}

#affordability-results-container div {
    padding-bottom: 0px;
    margin-bottom: 0px;
}

#affordability-result {
    font-size: 20px; /* Make text bigger */
    font-weight: bold; /* Make it bold */
    padding-bottom: 0; /* Remove padding from individual results */
}

/* Additional styles for the financial advice section */
#financial-advice {
    padding-bottom: 0; /* Remove the padding */
}

.interest-saving {
    font-size: 20px;
    font-weight: bold;
}

/* More specific rule for grand total result */
#results .grand-total .result {
    text-align: right;
    font-size: 24px;  /* Override to a larger font size */
    font-weight: bold;
}

/* Also update the grand total label, just to ensure it works */
#results .grand-total .label {
    text-align: left;
    font-size: 24px;
    font-weight: bold;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 500px) {
    #results p {
        display: block; /* Stack the label and result */
        text-align: left; /* Align everything to the left */
        padding-bottom: 5px; /* Reduce padding to fit more content */
    }

    #results p span.result {
        display: block; /* Make the result span take up the full width */
        text-align: left; /* Align the result to the left */
        margin-top: 5px; /* Add space between label and result */
        font-size: 16px; /* Adjust font size for mobile */
    }

    .bold-result {
        font-size: 16px; /* Adjust bold result text size for smaller screens */
        font-weight: bold;
    }

    /* Adjust the grand total styling on smaller screens */
    #results .grand-total .result, 
    #results .grand-total .label {
        display: block; /* Stack label and result for grand total */
        text-align: left; /* Align both to the left */
        font-size: 18px; /* Adjust font size for readability */
    }
}



/* Footer Styles */
footer {
    background: linear-gradient(to top, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    padding-top: 150px;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-top: auto; 
}

.left-section,
.center-section,
.right-section {
    display: flex;
    align-items: center; 
    justify-content: center; 
}

.left-section {
    align-items: center;
    display: flex;
    padding-left: 20px;
}

.links-container {
    display: flex;
    margin-left: 20px; 
}

.left-section ul {
    display: flex;
    list-style-type: none;
}

.left-section ul li {
    margin-right: 20px;
}

.center-section {
    flex-grow: 0;
    flex-shrink: 1;
    flex-basis: auto;
    text-align: center;
    color: #004080;
    font-size: 12px;
    font-family: Arial, sans-serif;
    align-self: flex-end;
    margin-left: 10px;
}

.right-section {
    justify-content: flex-end;
    padding-right: 20px;

}

footer a {
    color: #004080;
    transition: color 0.3s;
    text-decoration: none;
    font-weight: bold;
}

footer a:hover {
    color: #DC143C; 
}

.right-section a {
    display: inline-flex; 
    justify-content: center; 
    align-items: center; 
    margin-right: 20px; 
}

.right-section a:last-child {
    margin-right: 0; 
}

.right-section p {
    margin-right: 20px;
}

.social-media-links a:hover {
    color: #DC143C;
}

.fa-facebook-f, .fa-youtube, .fa-instagram {
    font-size: 32px; 
}

@media (max-width: 1200px) and (min-width: 768px) {
    header {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .logo {
        margin-bottom: 20px; /* Add some space between the logo and nav */
    }

    nav ul {
        display: flex;
        justify-content: center;
        width: 100%; /* Ensure nav takes full width */
    }

    nav ul li {
        margin-bottom: 10px; /* Add space between each menu item */
    }

    nav ul li a {
        font-size: 18px; /* Adjust the font size */
    }

    footer {
        flex-wrap: wrap; /* Allow sections to wrap onto new lines */
    }

    .right-section {
        order: 1; /* Show the right section first */
    }

    .center-section {
        order: 2; /* Show the center section after the right section */
        margin-left: 0; /* Remove the left margin */
        margin-bottom: 20px;
    }

    .left-section {
        order: 0; /* Left section stays first */
    }

    /* Move the center-section to a new line */
    .center-section {
        width: 100%; /* Take full width */
        text-align: center; /* Center the text */
        margin-top: 20px; /* Add some space above the center section */
    }
}

/* For screens 768px - 500px */
@media (max-width: 768px) and (min-width: 500px) {
    header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .logo img {
        margin-left: 0; /* Ensure logo aligns to the left */
        max-width: 300px;
        height: auto;
    }

        /* Show the burger menu and hide the navigation list */
        .menu-toggle {
            display: flex; /* Show the burger menu button */
            background: none; /* Remove any background color */
            border: none; /* Remove any borders */
            outline: none; /* Remove any focus outline */
            padding: 0; /* Remove any default padding */
            box-shadow: none; /* Remove any box shadow */
        }

        .menu-toggle::before {
            content: "Menu";
            margin-right: 10px;
        }
    
        /* Hide the nav list by default on smaller screens */
        nav ul {
            display: none; /* Hidden initially */
        }
    
        /* Show the nav list when the burger menu is clicked */
        .show-menu {
            display: flex; /* Display the dropdown when .show-menu is active */
            flex-direction: column;
            position: absolute;
            top: 100px; /* Ensure it's below the header */
            right: 0;
            background-color: white;
            width: 100%; /* Full width dropdown */
            text-align: right;
            padding: 10px 0;
        }
    
        nav ul li {
            margin: 10px 20px;
        }
    

        /* Stack footer sections vertically */
        footer {
            flex-direction: column;
            text-align: center;
            align-items: center; /* Ensure everything is centered */
            padding: 20px 0; /* Add some vertical padding for consistency */
        }
    
        .left-section,
        .center-section,
        .right-section {
            justify-content: center; /* Center align each section */
            align-items: center; /* Vertically center items within each section */
            width: 100%; /* Make each section take full width to center contents */
            margin-bottom: 20px; /* Consistent spacing between sections */
            padding: 0; /* Remove any extra padding */
        }
    
        .right-section {
            order: 1; /* Show the right section first */
        }
    
        .center-section {
            order: 2; /* Show the center section after the right section */
            margin-left: 0; /* Remove the left margin */
            margin-bottom: 20px;
        }
    
        .left-section {
            order: 0; /* Left section stays first */
        }
    
        .right-section p {
            display: none; /* Hide "Follow us on social media" */
        }
    
        .links-container {
            justify-content: center;
            margin-left: 0;
        }
    
        .right-section a {
            margin-right: 15px;
        }
}

@media (max-width: 500px) {

    header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .logo img {
        margin-left: 0; /* Ensure logo aligns to the left */
        max-width: 200px;
        height: auto;
    }

    /* Hide the nav by default and use the burger menu */
    /* Show the burger menu and hide the navigation list */
    .menu-toggle {
        display: flex; /* Show the burger menu button */
    }

    .menu-toggle::before {
        content: "Menu";
        margin-right: 10px;
    }

    /* Hide the nav list by default on smaller screens */
    nav ul {
        display: none; /* Hidden initially */
    }

    /* Show the nav list when the burger menu is clicked */
    .show-menu {
        display: flex; /* Display the dropdown when .show-menu is active */
        flex-direction: column;
        position: absolute;
        top: 60px; /* Ensure it's below the header */
        right: 0;
        background-color: white;
        width: 100%; /* Full width dropdown */
        text-align: right;
        padding: 10px 0;
    }

    nav ul li {
        margin: 10px 20px;
    }


    footer {
        flex-direction: column;
        text-align: center;
        align-items: center; /* Ensure everything is centered */
        padding: 20px 0; /* Add some vertical padding for consistency */
    }

    .left-section,
    .center-section,
    .right-section {
        justify-content: center; /* Center align each section */
        align-items: center; /* Vertically center items within each section */
        width: 100%; /* Make each section take full width to center contents */
        margin-bottom: 20px; /* Consistent spacing between sections */
        padding: 0; /* Remove any extra padding */
    }

    .right-section {
        order: 1; /* Show the right section first */
    }

    .center-section {
        order: 2; /* Show the center section after the right section */
        margin-left: 0; /* Remove the left margin */
        margin-bottom: 20px;
    }

    .left-section {
        order: 0; /* Left section stays first */
    }

    .right-section p {
        display: none; /* Hide "Follow us on social media" */
    }

    .links-container {
        justify-content: center;
        margin-left: 0;
    }

    .right-section a {
        margin-right: 15px;
    }
}

@media (max-width: 350px) {
    /* Shrink the logo gradually */
    .logo img {
        max-width: 150px; /* Limit the maximum width for very small screens */
        height: auto;
    }

    /* Show the burger menu and hide the navigation list */
    .menu-toggle {
        display: flex; /* Show the burger menu button */
    }

    .menu-toggle::before {
        display: none; /* Hide the "Menu" label */
    }

    /* Hide the nav list by default on smaller screens */
    nav ul {
        display: none; /* Hidden initially */
    }

    /* Show the nav list when the burger menu is clicked */
    .show-menu {
        display: flex; /* Display the dropdown when .show-menu is active */
        flex-direction: column;
        position: absolute;
        top: 60px; /* Ensure it's below the header */
        right: 0;
        background-color: white;
        width: 100%; /* Full width dropdown */
        text-align: right;
        padding: 10px 0;
    }

    nav ul li {
        margin: 10px 20px;
    }


    footer {
        flex-direction: column;
        text-align: center;
        align-items: center; /* Ensure everything is centered */
        padding: 20px 0; /* Add some vertical padding for consistency */
    }

    .left-section,
    .center-section,
    .right-section {
        justify-content: center; /* Center align each section */
        align-items: center; /* Vertically center items within each section */
        width: 100%; /* Make each section take full width to center contents */
        margin-bottom: 20px; /* Consistent spacing between sections */
        padding: 0; /* Remove any extra padding */
    }

    .right-section {
        order: 1; /* Show the right section first */
    }

    .center-section {
        order: 2; /* Show the center section after the right section */
        margin-left: 0; /* Remove the left margin */
        margin-bottom: 20px;
    }

    .left-section {
        order: 0; /* Left section stays first */
    }

    .left-section img {
        display: none;
    }

    .right-section p {
        display: none; /* Hide "Follow us on social media" */
    }

    .links-container {
        justify-content: center;
        margin-left: 0;
    }

    .right-section a {
        margin-right: 15px;
    }
}
