/* Loan EMI Calculator Styles */
.sth-loan-emi-calculator {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 1000px;
    margin: 0 auto;
}

.sth-emi-input-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.sth-emi-input-group {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.sth-emi-input-group:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.1);
}

.sth-emi-input-group h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    text-align: center;
    font-weight: 600;
}

.sth-emi-input-field {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: white;
}

.sth-emi-input-field:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.sth-emi-amount-container,
.sth-emi-rate-container {
    position: relative;
    display: flex;
    align-items: center;
}

.sth-currency-symbol {
    position: absolute;
    left: 15px;
    font-weight: bold;
    color: #007bff;
    font-size: 18px;
    z-index: 1;
}

.sth-emi-amount-container input {
    padding-left: 40px;
}

.sth-rate-symbol {
    position: absolute;
    right: 15px;
    font-weight: bold;
    color: #007bff;
    font-size: 18px;
}

.sth-emi-rate-container input {
    padding-right: 40px;
}

.sth-emi-amount-slider,
.sth-emi-rate-slider,
.sth-emi-tenure-slider {
    margin: 15px 0;
}

.sth-emi-amount-slider input[type="range"],
.sth-emi-rate-slider input[type="range"],
.sth-emi-tenure-slider input[type="range"] {
    width: 100%;
    height: 8px;
    background: #ddd;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

.sth-emi-amount-slider input[type="range"]::-webkit-slider-thumb,
.sth-emi-rate-slider input[type="range"]::-webkit-slider-thumb,
.sth-emi-tenure-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
}

.sth-emi-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.sth-emi-tenure-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: center;
}

.sth-emi-tenure-toggle label {
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
    background: #e9ecef;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid transparent;
}

.sth-emi-tenure-toggle input[type="radio"] {
    display: none;
}

.sth-emi-tenure-toggle input[type="radio"]:checked + label {
    background: #007bff;
    color: white;
    border-color: #0056b3;
    transform: scale(1.05);
}

.sth-emi-hint {
    font-size: 14px;
    color: #6c757d;
    margin-top: 10px;
    font-style: italic;
    text-align: center;
}

.sth-emi-calculate-btn {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, #fd7e14, #e63946);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sth-emi-calculate-btn:hover {
    background: linear-gradient(135deg, #e63946, #d62d20);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(230, 57, 70, 0.4);
}

.sth-emi-result {
    margin-top: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    border-left: 6px solid #fd7e14;
}

.sth-emi-result-header h3 {
    margin: 0 0 25px 0;
    color: #333;
    text-align: center;
    font-size: 24px;
}

.sth-emi-main-result {
    text-align: center;
    margin-bottom: 30px;
    padding: 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.sth-emi-value {
    font-size: 32px;
    font-weight: bold;
    color: #333;
}

.sth-emi-value span {
    color: #fd7e14;
    font-size: 36px;
}

.sth-emi-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.sth-emi-breakdown-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-top: 4px solid #007bff;
}

.sth-emi-breakdown-label {
    display: block;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
    font-size: 14px;
}

.sth-emi-breakdown-value {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #007bff;
}

.sth-emi-charts {
    margin-bottom: 30px;
}

.sth-emi-chart-container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.sth-emi-chart-container h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
}

.sth-emi-pie-chart {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin: 20px auto;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#sth-pie-canvas {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 50%;
}

.sth-emi-pie-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.sth-emi-pie-total {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.sth-emi-pie-amount {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.sth-emi-pie-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.sth-emi-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.sth-emi-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.sth-principal-color {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.sth-interest-color {
    background: linear-gradient(135deg, #fd7e14, #e63946);
}

.sth-emi-amortization {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.sth-emi-amortization h4 {
    margin: 0 0 20px 0;
    color: #333;
    text-align: center;
    font-size: 18px;
}

.sth-emi-schedule-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 12px;
}

.sth-emi-tab-btn {
    padding: 15px 30px;
    border: 2px solid #007bff;
    background: white;
    color: #007bff;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 160px;
    position: relative;
    overflow: hidden;
}

.sth-emi-tab-btn:hover {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
}

.sth-emi-tab-btn.active {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    transform: translateY(-2px);
}

.sth-emi-tab-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.sth-emi-tab-btn:hover:before {
    left: 100%;
}

.sth-tab-icon {
    margin-right: 8px;
    font-size: 18px;
}

.sth-emi-tab-content {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.sth-emi-tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.sth-emi-monthly-container,
.sth-emi-yearly-container {
    margin-top: 20px;
}

.sth-emi-section-header {
    text-align: center;
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    border-left: 5px solid #007bff;
}

.sth-emi-section-header h5 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 20px;
    font-weight: 700;
}

.sth-emi-section-header p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.sth-emi-monthly-controls,
.sth-emi-yearly-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.sth-emi-nav-btn {
    padding: 8px 16px;
    border: 2px solid #007bff;
    background: white;
    color: #007bff;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.sth-emi-nav-btn:hover:not(:disabled) {
    background: #007bff;
    color: white;
    transform: translateY(-1px);
}

.sth-emi-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #ccc;
    color: #ccc;
}

#sth-month-range {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.sth-emi-amortization-table {
    overflow-x: auto;
}

.sth-emi-table-header {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 15px;
    background: #007bff;
    color: white;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
}

.sth-emi-table-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    text-align: center;
    transition: background 0.3s ease;
}

/* Monthly breakdown table (5 columns) */
#monthly-tab .sth-emi-table-header,
#monthly-tab .sth-emi-table-row {
    grid-template-columns: repeat(5, 1fr);
}

.sth-emi-table-row:hover {
    background: #f8f9fa;
}

.sth-emi-table-row:nth-child(even) {
    background: #f8f9fa;
}

.sth-emi-additional-info {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.sth-emi-additional-info h4 {
    margin: 0 0 20px 0;
    color: #333;
    text-align: center;
    font-size: 18px;
}

.sth-emi-notes {
    display: grid;
    gap: 15px;
}

.sth-emi-note {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    line-height: 1.6;
}

.sth-emi-note strong {
    color: #333;
    display: block;
    margin-bottom: 5px;
}

/* Currency display formatting */
.sth-currency-display {
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sth-loan-emi-calculator {
        padding: 20px;
        margin: 10px;
    }
    
    .sth-emi-schedule-tabs {
        flex-direction: column;
        gap: 10px;
    }
    
    .sth-emi-tab-btn {
        min-width: auto;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .sth-tab-icon {
        font-size: 16px;
    }
    
    .sth-emi-input-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sth-emi-input-group {
        padding: 20px;
    }
    
    .sth-emi-value {
        font-size: 24px;
    }
    
    .sth-emi-value span {
        font-size: 28px;
    }
    
    .sth-emi-breakdown {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .sth-emi-breakdown-value {
        font-size: 16px;
    }
    
    .sth-emi-pie-chart {
        width: 150px;
        height: 150px;
    }
    
    .sth-emi-pie-center {
        width: 90px;
        height: 90px;
    }
    
    .sth-emi-pie-legend {
        flex-direction: column;
        gap: 10px;
    }
    
    .sth-emi-table-header,
    .sth-emi-table-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .sth-emi-table-header div:nth-child(3),
    .sth-emi-table-header div:nth-child(4),
    .sth-emi-table-row div:nth-child(3),
    .sth-emi-table-row div:nth-child(4) {
        display: none;
    }
}

@media (max-width: 480px) {
    .sth-emi-breakdown {
        grid-template-columns: 1fr;
    }
    
    .sth-emi-breakdown-item {
        padding: 15px;
    }
    
    .sth-emi-pie-chart {
        width: 120px;
        height: 120px;
    }
    
    .sth-emi-pie-center {
        width: 70px;
        height: 70px;
    }
    
    .sth-emi-pie-amount {
        font-size: 12px;
    }
    
    .sth-emi-tenure-toggle {
        flex-direction: column;
        gap: 8px;
    }
    
    .sth-emi-tenure-toggle label {
        padding: 10px;
        text-align: center;
    }
}
