/* EMI Loan Calculator Styles */
.emi-calculator-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.emi-calculator {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Header */
.emi-header {
    background: var(--emi-primary, #4a90e2);
    color: white;
    padding: 30px;
    text-align: center;
}

.emi-header h2 {
    margin: 0 0 10px 0;
    font-size: 32px;
    font-weight: 700;
}

.emi-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
}

/* Body */
.emi-body {
    display: flex;
    flex-wrap: wrap;
    min-height: 500px;
}

/* Input Section */
.emi-inputs {
    flex: 1;
    min-width: 350px;
    padding: 40px;
    background: #f8fafc;
}

.input-group {
    margin-bottom: 30px;
}

.input-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.input-label label {
    font-weight: 600;
    color: #2d3748;
    font-size: 16px;
}

.input-preview {
    background: var(--emi-primary, #4a90e2);
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.emi-slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    background: #e2e8f0;
    border-radius: 4px;
    margin: 15px 0;
    outline: none;
}

.emi-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--emi-primary, #4a90e2);
    cursor: pointer;
    border: 4px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.emi-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.emi-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--emi-primary, #4a90e2);
    cursor: pointer;
    border: 4px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.input-field {
    display: flex;
    align-items: center;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.3s;
}

.input-field:focus-within {
    border-color: var(--emi-primary, #4a90e2);
}

.currency-symbol, .input-suffix {
    padding: 0 20px;
    background: #edf2f7;
    font-weight: 600;
    color: #4a5568;
    height: 56px;
    display: flex;
    align-items: center;
    font-size: 18px;
}

.tenure-field {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.tenure-select {
    padding: 0 20px;
    border: none;
    background: #edf2f7;
    font-size: 16px;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    outline: none;
    min-width: 120px;
}

.emi-input {
    flex: 1;
    border: none;
    padding: 16px 20px;
    font-size: 18px;
    font-weight: 500;
    outline: none;
    color: #2d3748;
    background: white;
}

.emi-input:focus {
    background: #f7fafc;
}

.emi-calculate-button {
    background: var(--emi-primary, #4a90e2);
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.emi-calculate-button:hover {
    background: var(--emi-primary-dark, #357ae8);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(53, 122, 232, 0.3);
}

/* Results Section */
.emi-results {
    flex: 1;
    min-width: 350px;
    padding: 40px;
    background: white;
}

.results-header {
    margin-bottom: 30px;
}

.results-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 24px;
    font-weight: 600;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.result-card {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.result-icon {
    font-size: 28px;
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.result-content {
    flex: 1;
}

.result-label {
    font-size: 14px;
    color: #718096;
    margin-bottom: 5px;
}

.result-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--emi-primary, #4a90e2);
}

/* Visual Chart */
.emi-visual {
    background: #f8fafc;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.visual-chart {
    display: flex;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.chart-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: 600;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.principal-bar {
    background: var(--emi-primary, #4a90e2);
}

.interest-bar {
    background: var(--emi-secondary, #2ecc71);
}

.chart-label {
    font-size: 14px;
    margin-bottom: 3px;
}

.chart-value {
    font-size: 16px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4a5568;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.principal-dot {
    background: var(--emi-primary, #4a90e2);
}

.interest-dot {
    background: var(--emi-secondary, #2ecc71);
}

/* Details Table */
.emi-details {
    background: #f8fafc;
    padding: 25px;
    border-radius: 12px;
}

.emi-details table {
    width: 100%;
    border-collapse: collapse;
}

.emi-details tr {
    border-bottom: 1px solid #e2e8f0;
}

.emi-details tr:last-child {
    border-bottom: none;
}

.emi-details td {
    padding: 15px 0;
    font-size: 15px;
    color: #4a5568;
}

.emi-details td:first-child {
    font-weight: 500;
    color: #2d3748;
}

.emi-details td:last-child {
    text-align: right;
    font-weight: 600;
    color: var(--emi-primary, #4a90e2);
}

/* Responsive Design */
@media (max-width: 900px) {
    .emi-body {
        flex-direction: column;
    }
    
    .emi-inputs,
    .emi-results {
        padding: 25px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .emi-header {
        padding: 25px 20px;
    }
    
    .emi-header h2 {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .emi-calculator-wrapper {
        padding: 10px;
    }
    
    .emi-inputs,
    .emi-results {
        padding: 20px;
    }
    
    .emi-input {
        padding: 14px;
        font-size: 16px;
    }
    
    .result-value {
        font-size: 20px;
    }
    
    .tenure-field {
        grid-template-columns: 1fr;
    }
}