/* Add this at the beginning of your CSS file */

/* Apply a box-sizing border-box to all elements */
* {
    box-sizing: border-box;
}

.emiContainer {
    height: auto;
    border-radius: 20px;
    padding: 20px;
    margin: 50px 0;
    background-image: linear-gradient(to bottom left, #e4dfec, white, white);
    box-shadow: 0 0 10px 0 rgba(0,0,0,.2);
}

.sub-emiContainer {
    display: flex;
    width: 100%;
    gap: 50px;
    height: max-content;
    justify-content: space-evenly;
}

.header {
    width: 100%;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

    .header button {
        height: max-content;
        width: max-content;
        padding: 10px;
        border: none;
        background-color: transparent;
        font-size: 35px;
        color: #36a2eb;
    }

        .header button:hover {
            cursor: pointer;
        }

.view {
    width: 450px;
}

.breakup {
    width: 350px;
}

.details input {
    width: 100%;
}

.detail {
    display: flex;
    justify-content: space-between;
}

.emifooter {
    display: flex;
    justify-content: space-between;
}

/* Sliders */
input[type="range"] {
    appearance: none;
    margin: 10px 0;
    width: 100%;
}

    input[type="range"]:focus {
        outline: none;
    }

    input[type="range"]::-webkit-slider-runnable-track {
        width: 100%;
        height: 6px;
        cursor: pointer;
        background: #36a2eb;
        border-radius: 10px;
    }

    input[type="range"]::-webkit-slider-thumb {
        box-shadow: 2px 2px 5px #b3b3b3, -1px -1px 3px grey;
        border: 5px solid #ffffff;
        height: 20px;
        width: 20px;
        border-radius: 50%;
        background: #36a2eb;
        cursor: pointer;
        margin-top: -6px;
        -webkit-appearance: none;
    }

    input[type="range"]:focus::-webkit-slider-runnable-track {
        background: #b3b3b3;
    }

    input[type="range"]::-moz-range-track {
        width: 100%;
        height: 6px;
        cursor: pointer;
        background: #36a2eb;
        border-color: transparent;
        border-width: 16px 0;
        color: transparent;
        border-radius: 10px;
    }

    input[type="range"]::-moz-range-thumb {
        box-shadow: 2px 2px 5px #b3b3b3, -1px -1px 3px grey;
        border: 5px solid #ffffff;
        height: 20px;
        width: 20px;
        border-radius: 50%;
        background: #36a2eb;
        cursor: pointer;
        margin-top: -6px;
    }

    input[type="range"]::-ms-track {
        width: 100%;
        height: 6px;
        cursor: pointer;
        background: #36a2eb;
        border-color: transparent;
        border-width: 16px 0;
        color: transparent;
        border-radius: 10px;
    }

    input[type="range"]::-ms-fill-lower {
        background: #36a2eb;
        border-radius: 5px;
    }

    input[type="range"]::-ms-fill-upper {
        background: #36a2eb;
        border-radius: 5px;
    }

    input[type="range"]::-ms-thumb {
        box-shadow: 2px 2px 5px #b3b3b3, -1px -1px 3px grey;
        border: 5px solid #ffffff;
        height: 20px;
        width: 20px;
        border-radius: 50%;
        background: #36a2eb;
        cursor: pointer;
        margin-top: -6px;
    }

    input[type="range"]:focus::-ms-fill-lower {
        background: #36a2eb;
    }

    input[type="range"]:focus::-ms-fill-upper {
        background: #36a2eb;
    }

/* Price */
#price {
    color: #130f31;
    font-size: 25px;
}

/*.loan-details {
    width: 70%;
    display: flex;
    justify-content: space-evenly;
    gap: 40px;
}*/

.loan-details {
    width: 100%;
    display: flex;
    justify-content: space-evenly;
    gap: 40px;
}

.chart-details {
    flex: 1 1 250px; /* Adjust width as needed */
    margin-bottom: 0px;
    text-align: center;
}


.chart-details .bold-text {
    margin-bottom: 0;
    color:#198f47;
}

#price-container {
    color: #198f47;
    margin-top: 50px;
    font-weight: bold;
}

    #price-container::before {
        content: "Monthly Payable:";
        font-size: 12px;
        display: block;
        font-weight: bold;
    }

.emifooter {
    display: flex;
    align-items: center;
}

    .emifooter button {
        color: #ffffff;
        margin-left: 27px;
        margin-top: 34px;
        border: 2px solid #198f47;
        border-radius: 20px;
        background-color: #198f47;
    }

/* Modal Popup Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: white;
    margin: 1% auto;
    padding-left: 11px;
    padding-right: 11px;
    border-radius: 20px;
    width: 80%;
    max-height: calc(100% - 40px); /* Adjust based on modal padding */
    overflow-y: auto;
}

    /* Sticky header */
    .modal-content thead {
        position: sticky;
        top: 0;
        z-index: 1;
    }

/* Close button positioned absolute */
.close {
    color: white;
    position: fixed;
    top: 10px;
    right: 110px; /* Adjust based on your design */
    font-size: 30px;
    font-weight: bold;
    z-index: 2; /* Ensure it's above the content */
}

    .close:hover,
    .close:focus {
        color: rgb(243, 84, 84);
        text-decoration: none;
        cursor: pointer;
    }

/* Table styles */
#emiChartTable {
    width: 100%;
    border-collapse: collapse;
    color: black;
}

    #emiChartTable thead {
        background-color: #ebe1e1;
        border-bottom: 2px solid #ffffff;
    }

    #emiChartTable th,
    #emiChartTable td {
        padding: 8px;
        text-align: center;
    }

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .sub-emiContainer {
        flex-direction: column;
        gap: 20px;
    }

    .view {
        width: 100%;
    }

    .breakup {
        width: 100%;
    }

    .card {
        width: 100%;
    }

    .loan-details {
        flex-direction: column;
        gap: 20px;
    }

    /*.chart-details {
        margin-right: 0;
        margin-bottom: 20px;
    }*/

    .chart-details {
        flex-basis: calc(50% - 20px); /* Two columns on smaller screens */
    }

    #emiChartTable thead {
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .header {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

        .header button {
            font-size: 25px;
        }

    .chart-details {
        flex-basis: calc(100% - 20px); /* Full width on extra small screens */
    }
}

@media screen and (max-width: 360px) {
    .card {
        width: 100%; /* Adjust width to fit smaller screens */
    }

    .chart-details {
        flex-basis: calc(100% - 20px); /* Full width for chart details */
    }
}