/* EMI Calculator Custom Styles */
:root {
    --emi-primary: #e63a27; /* Matching website red theme */
    --emi-secondary: #003666;
    --emi-dark-red: #c1180b;
}

.emi-calculator-container {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-top: -50px;
    position: relative;
    z-index: 10;
    font-family: 'Inter', sans-serif;
}

.calculator-header {
    background: var(--emi-primary);
    padding: 25px;
    text-align: center;
}

.calculator-header h3 {
    color: #fff;
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.calculator-body {
    padding: 40px;
}

.calculator-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.tab-btn {
    padding: 10px 25px;
    border: 2px solid #eee;
    background: #fff;
    border-radius: 50px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: var(--emi-primary);
    color: #fff;
    border-color: var(--emi-primary);
}

.input-group {
    margin-bottom: 55px;
}

.label-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    margin-bottom: 20px;
}

.label-box label {
    font-weight: 700;
    color: #333;
    font-size: 16px;
    margin: 0;
}

.input-with-symbol {
    position: relative;
    display: flex;
    align-items: stretch;
    border: 1.5px solid var(--emi-dark-red);
    border-radius: 8px;
    overflow: hidden;
    width: 190px;
}

.input-with-symbol input {
    width: 100%;
    padding: 10px 15px;
    border: none;
    font-size: 20px;
    font-weight: 800;
    color: var(--emi-dark-red);
    text-align: center;
    background: transparent;
}

.symbol-left, .symbol-right {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    background: #f5f5f5;
    color: #666;
    font-size: 18px;
    border-right: 1.5px solid var(--emi-dark-red);
}

.symbol-right {
    border-right: none;
    border-left: 1.5px solid var(--emi-dark-red);
}

.range-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: linear-gradient(to right, var(--emi-dark-red) var(--progress, 50%), #eee var(--progress, 50%));
    border-radius: 5px;
    outline: none;
}

/* Chrome, Safari, Opera, Edge */
.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: var(--emi-dark-red);
    border: 3px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    margin-top: -1px;
}

/* Firefox */
.range-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--emi-dark-red);
    border: 3px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.range-slider::-moz-range-progress {
    background-color: var(--emi-dark-red); 
    height: 6px;
    border-radius: 5px;
}

.range-marks {
    margin-top: 15px;
    padding: 0;
    position: relative;
    height: 40px;
    width: 100%;
}

.mark-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    transform: translateX(-50%);
}

.mark-tick {
    width: 1px;
    height: 10px;
    background: #ccc;
    margin-bottom: 5px;
}

.mark-label {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    white-space: nowrap;
}

.tenure-toggle {
    display: flex;
    border: 1.5px solid var(--emi-dark-red);
    border-radius: 8px;
    overflow: hidden;
    margin-left: 20px;
}

.toggle-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    background: #fff;
    color: #666;
    border: none;
    transition: all 0.3s;
}

.toggle-btn.active {
    background: var(--emi-dark-red);
    color: #fff;
}

/* Results Section */
.result-container {
    background: #fcfcfc;
    border-radius: 15px;
    padding: 30px;
    height: 100%;
    border: 1px solid #eee;
}

.result-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #ddd;
}

.result-header h4 {
    font-weight: 700;
    color: #666;
    margin-bottom: 10px;
}

.emi-value {
    font-size: 32px;
    font-weight: 900;
    color: var(--emi-primary);
}

.result-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.summary-item h5 {
    font-size: 14px;
    color: #888;
    margin-bottom: 5px;
}

.summary-item p {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.chart-container {
    text-align: center;
}

.chart-container h5 {
    margin-bottom: 20px;
    font-weight: 700;
}

#emiChart {
    max-width: 200px;
    margin: 0 auto;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: #666;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.dot-interest {
    background: var(--emi-primary);
}

.dot-principal {
    background: var(--emi-secondary);
}

@media (max-width: 991px) {
    .emi-calculator-container {
        margin-top: 30px;
        border-radius: 15px;
    }

    .calculator-body {
        padding: 20px;
    }
}

@media (max-width: 767px) {
    .calculator-header h3 {
        font-size: 20px;
    }

    .calculator-tabs {
        flex-wrap: wrap;
        gap: 8px;
    }

    .tab-btn {
        padding: 8px 15px;
        font-size: 13px;
        flex: 1 1 calc(50% - 10px);
        text-align: center;
    }

    .label-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .input-with-symbol {
        width: 100%;
    }

    .tenure-toggle {
        margin-left: 0;
        width: 100%;
    }

    .toggle-btn {
        flex: 1;
        text-align: center;
    }

    .emi-value {
        font-size: 28px;
    }

    .result-summary {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .mark-label {
        font-size: 9px;
    }

    /* Hide middle marks on very small screens to prevent overlap */
    .range-marks .mark-item:nth-child(even) {
        display: none;
    }
}

@media (max-width: 480px) {
    .tab-btn {
        flex: 1 1 100%;
    }
}
