body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f9;
    color: #333;
    margin: 0;
    height: 100vh;
    overflow: hidden; /* Disable main body scroll */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

#auth-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

#auth-container button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#auth-container button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

#auth-container #signin{
    background-color: #ffffff;
    color: #007bff;
    border: 1px solid #ccc;
}

#auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.auth-form {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    width: 420px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #888;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #333;
}

.auth-form h2 {
    margin-top: 0;
    margin-bottom: 25px;
    text-align: center;
    font-size: 28px;
    color: #333;
}

.auth-form .form-group {
    margin-bottom: 25px;
}

.auth-form .form-group label {
    font-weight: 600;
    color: #555;
}

.auth-form .form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.auth-form .form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.auth-form button[type="submit"] {
    width: 100%;
    padding: 14px;
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.auth-form button[type="submit"]:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.forgot-password {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.forgot-password a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s, text-decoration 0.3s;
    padding: 5px;
}

.forgot-password a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.forgot-password br {
    display: none;
}

.navbar {
    border-bottom: 1px solid #e0e0e0;
    padding: 0.5rem 0;
    margin-bottom: 2rem
}

.navbar-brand .logo {
    width: 200px;
}

.navbar-nav .nav-link {
    font-weight: 600;
    color: #333;
}

.navbar-nav .nav-link:hover {
    color: #007bff;
}

.navbar .btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.navbar .btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

.logo {
    width: 12rem;
    height: auto;
}





.contact-btn {
    background: none;
    border: none;
    color: #007bff;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: color 0.3s;
    margin-right: 25px;
}

.contact-btn:hover {
    color: #0056b3;
}

#contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

#contact-modal .auth-form {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    width: 420px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

#contact-modal textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
    resize: vertical;
}

#contact-modal textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.how-to-use-link {
    position: relative;
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: color 0.3s;
    padding-bottom: 5px;
}

.how-to-use-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: #0056b3;
    transition: all 0.3s ease-in-out;
}

.how-to-use-link:hover {
    color: #0056b3;
}

.how-to-use-link:hover::after {
    width: 100%;
    left: 0;
}

.content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    flex-grow: 1;
    overflow: hidden; /* Contain the two scrolling columns */
}

.input-form {
    width: 380px;
    flex-shrink: 0;
    overflow-y: auto;
    height: 100%;
    padding-right: 15px; /* For scrollbar spacing */
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.tenure-input {
    display: flex;
    gap: 10px;
}

.tenure-input input {
    width: 70%;
}

.tenure-input select {
    width: 30%;
}

.custom-range {
    border: 1px solid #e0e0e0;
    padding: 15px;
    border-radius: 4px;
    margin-top: 10px;
}

.radio-group label {
    margin-right: 15px;
    font-weight: normal;
}

.prepayment-container {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 0 20px 20px 20px;
}

.prepayment-container .collapsible-header {
    border-bottom: none;
    padding: 15px 0;
}

.calculate-btn {
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.calculate-btn:hover {
    background-color: #0056b3;
}

.results {
    flex-grow: 1;
    min-width: 0; /* Prevents flexbox overflow */
    overflow-y: auto;
    height: 100%;
    padding-right: 15px; /* For scrollbar spacing */
    display: none;
}

.results.show {
    display: block;
}

.summary-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.summary-item {
    flex: 1 1 200px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: left;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.summary-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.summary-item-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.summary-item-header .icon {
    font-size: 24px;
    margin-right: 10px;
}

.summary-item p {
    margin: 0;
    font-size: 16px;
    color: #666;
}

.summary-item h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #007bff;
}

.summary-item.comparison .comparison-values {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.comparison-values .before,
.comparison-values .after {
    font-size: 18px;
    font-weight: 600;
}

.comparison-values .before {
    color: #dc3545;
}

.comparison-values .after {
    color: #28a745;
}

.comparison-values .arrow {
    font-size: 24px;
    color: #007bff;
}

.carousel-container {
    position: relative;
    margin-bottom: 30px;
}

.carousel-slides {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    box-sizing: border-box;
    display: none;
}

.carousel-slide.active {
    display: block;
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
}

.carousel-control.prev {
    left: 10px;
}

.carousel-control.next {
    right: 10px;
}

.carousel-indicators {
    text-align: center;
    position: absolute;
    bottom: 10px;
    width: 100%;
}

.indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #bbb;
    border-radius: 50%;
    margin: 0 5px;
    cursor: pointer;
}

.indicator.active {
    background-color: #717171;
}

.graph-container {
    margin-bottom: 30px;
}

.graph-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.graph-switch {
    display: flex;
    align-items: center;
}

.graph-switch label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.graph-switch span {
    margin-left: 8px;
}

.graph-switch .slider {
    position: relative;
    cursor: pointer;
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 20px;
    transition: background-color 0.3s;
}

.graph-switch .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.graph-switch input {
    display: none;
}

.graph-switch input:checked + .slider {
    background-color: #007bff;
}

.graph-switch input:checked + .slider:before {
    transform: translateX(20px);
}

.payoff-table-container {
    overflow-x: auto; /* Makes table scrollable on small screens */
    position: relative;
    overflow-y: auto;
    max-height: 600px; /* Adjust as needed */
}

.payoff-table-container thead th {
    position: -webkit-sticky; /* For Safari */
    position: sticky;
    top: 0;
    z-index: 1;
}

.collapsible-column {
    display: none;
}

.payoff-table-container .table-header {
    position: -webkit-sticky; /* For Safari */
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
    width: auto;
    padding-top: 10px;
    padding-bottom: 10px;
}

.payoff-table-container thead th {
    top: 48px; /* Adjust this value based on the height of the table-header */
}

.payoff-table-container .table-header h2 {
    margin: 0;
    font-size: 18px;
    flex-grow: 1;
    text-align: center;
}

.payoff-table-container .table-header button {
    padding: 6px 10px;
    color: #007bff;
    background-color: transparent;
}

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

td div input {
    padding: 7px;
    width: 70%;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.payoff-table-container button {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}
/*  */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th.separator, td.separator {
    border-left: 1.5px dashed #ccc;
    padding: 0;
}

thead th {
    background-color: #f2f2f2;
    font-weight: 600;
}

.year-row {
    cursor: pointer;
    background-color: #e9f5ff;
    font-weight: bold;
}

.year-row:hover {
    background-color: #d4eaff;
}

.toggle-icon {
    float: right;
    font-size: 24px;
}

.edit-btn, .save-btn {
    margin-left: 10px;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 3px;
    cursor: pointer;
}

.edit-btn {
    border: 1px solid #007bff;
    color: #007bff;
    background: white;
}

.save-btn {
    border: 1px solid #28a745;
    color: #28a745;
    background: white;
}

.bulk-update-container,
.investment-analysis-container {
    background: #fff;
    padding: 0;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.bulk-update-container h3 {
    margin-top: 0;
}

.apply-btn {
    width: 100%;
    padding: 10px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.apply-btn:hover {
    background-color: #218838;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.collapsible-header h2, .collapsible-header h3 {
    margin: 0;
    font-size: 18px;
}

.collapsible-content {
    padding: 20px;
}

.loan-paid-off-divider td {
    background: linear-gradient(45deg, #005c4b, #00bfa5);
    color: white;
    text-align: center;
    font-weight: bold;
    font-size: large;
    padding: 1.2rem;
}


.positive {
    color: #28a745 !important;
}

.negative {
    color: #dc3545 !important;
}

.investment-feature .collapsible-header {
    background: linear-gradient(45deg, #4a00e0, #8e2de2);
    color: #fff;
    border-bottom: none;
}

.investment-feature .collapsible-header h3 {
    font-weight: 600;
    flex-grow: 1;
    text-align: center;
    margin-left: 24px; /* To balance the space taken by the toggle icon */
}

.bulk-update-feature .collapsible-header {
    background: linear-gradient(45deg, #0056b3, #007bff);
    color: #fff;
    border-bottom: none;
}

.bulk-update-feature .collapsible-header h3 {
    font-weight: 600;
    flex-grow: 1;
    text-align: center;
    margin-left: 24px; /* To balance the space taken by the toggle icon */
}

.comparison-values .age-values {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: bold;
}

.comparison-values .before {
    color: #007bff;
}

.comparison-values .after {
    color: #28a745;
}

.comparison-values .separator {
    color: #ccc;
}

#currencyDropdown{
    background-color: #28a745;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .content {
        flex-direction: column;
        overflow-y: auto; /* Allow vertical scrolling for the whole content area */
        height: auto;
    }

    .input-form, .results {
        width: 100%;
        overflow-y: visible; /* Disable individual scrolling */
        height: auto;
        padding-right: 0;
    }

    .results {
        margin-top: 20px;
    }
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info span {
    font-weight: 600;
}

@media (max-width: 991.98px) {
    .navbar-collapse .d-flex {
        width: 100%;
        flex-direction: column;
        align-items: stretch !important;
    }

    .navbar-collapse .d-flex .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .navbar-collapse .d-flex .d-flex {
        width: 100%;
        margin-bottom: 1rem;
        flex-direction: column;
        align-items: stretch !important;
    }

    .dropdown.ms-3{
        margin-left: 0 !important;
        width: 100%;
    }

    .currency-selector .form-select {
        width: 100% !important;
    }
}

@media (max-width: 980px) {
    .navigation-menu {
        flex-direction: column;
        gap: 15px;
        width: 100%;
        align-items: center;
    }

    .header h1 {
        font-size: 18px; /* Adjust for smaller screens */
    }

    .logo {
        width: 10rem;
    }

    .menu-toggle {
        display: block; /* Show hamburger menu */
    }

    .navigation-menu {
        display: none;
        position: absolute;
        top: 70px; /* Adjust as needed */
        right: 20px;
        background-color: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
        gap: 15px;
        z-index: 100;
    }

    .nav-group-left, .nav-group-right {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }

    #auth-container button{
        margin-bottom: 10px;
    }

    .navigation-menu.is-open {
        display: flex;
    }

    #auth-container {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    #auth-container button {
        width: 100%;
        text-align: center;
    }

    .navigation-menu .how-to-use-link {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 992px) {
    .content {
        flex-direction: column;
        overflow-y: auto; /* Allow vertical scrolling for the whole content area */
        height: auto;
    }

    .input-form, .results {
        width: 100%;
        overflow-y: visible; /* Disable individual scrolling */
        height: auto;
        padding-right: 0;
    }

    .results {
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    .header {
        flex-direction: row; /* Revert to row for alignment */
        justify-content: space-between;
    }

    .header h1 {
        font-size: 20px;
    }

    .summary-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 15px;
    }

    .summary-item h3 {
        font-size: 18px;
    }

    th, td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .carousel-slide canvas {
        min-height: 300px;
    }

    #loanChart {
        height: 250px !important;
    }

    .tenure-input {
        flex-direction: column;
    }

    .tenure-input input,
    .tenure-input select {
        width: 100%;
    }

    .summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .payoff-table-container {
        font-size: 12px;
    }

    th, td {
        padding: 6px;
    }

    .edit-btn, .save-btn {
        padding: 2px 6px;
        font-size: 11px;
    }

    .header-left h1 {
        display: none;
    }

    .header h1{
        display: none;
    }
    .back-link{
        text-align: center;
        padding: 8px !important;
        font-size: 14px;
    }
}

#loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3498db;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
}

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

.blur-background {
    filter: blur(5px);
    transition: filter 0.3s;
}
