/* Main Container */
.emi-calculator-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 25px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    border: 1px solid #eaeaea;
}

/* Header Styles */
.emi-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.emi-header h2 {
    color: #2c3e50;
    font-size: 28px;
    margin: 0 0 10px;
}

.emi-header h2 i {
    margin-right: 10px;
    color: #3498db;
}

.emi-header p {
    color: #7f8c8d;
    font-size: 16px;
    margin: 0;
}

/* Form Styles */
.emi-form {
    background: #f9fbfd;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
}

.form-group label i {
    margin-right: 10px;
    color: #3498db;
    width: 20px;
}

.form-group input[type="number"] {
    width: 100%;
    padding: 14px 15px;
    border: 2px solid #e1e5eb;
    border-radius: 8px;
    font-size: 16px;
    color: #495057;
    transition: all 0.3s;
    box-sizing: border-box;
    background: #fff;
}

.form-group input[type="number"]:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.range-container {
    margin-top: 12px;
    position: relative;
}

.form-group input[type="range"] {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    background: #e1e5eb;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.form-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.form-group input[type="range"]::-webkit-slider-thumb:hover {
    background: #2980b9;
}

.tenure-container {
    display: flex;
    gap: 10px;
}

.tenure-container input[type="number"] {
    flex: 1;
}

.tenure-container select {
    width: 100px;
    padding: 0 15px;
    background: #3498db;
    color: white;
    border: 2px solid #3498db;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.tenure-container select:hover {
    background: #2980b9;
    border-color: #2980b9;
}

#tenure-unit-label {
    position: absolute;
    right: 0;
    bottom: -25px;
    font-size: 14px;
    color: #7f8c8d;
}

/* Button Styles */
.emi-button {
    width: 100%;
    padding: 16px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.emi-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.emi-button:active {
    transform: translateY(0);
}

/* Results Styles */
.emi-results {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: opacity 0.3s;
}

.emi-results.loading {
    opacity: 0.7;
    pointer-events: none;
}

.results-header {
    text-align: center;
    margin-bottom: 25px;
}

.results-header h3 {
    color: #2c3e50;
    font-size: 22px;
    margin: 0;
}

.results-header h3 i {
    margin-right: 10px;
    color: #3498db;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.result-card:hover {
    transform: translateY(-5px);
}

.result-icon {
    width: 50px;
    height: 50px;
    background: #3498db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.result-icon i {
    font-size: 22px;
    color: white;
}

.result-content {
    flex: 1;
}

.result-title {
    font-size: 15px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.result-value {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
}

/* Payment Breakdown */
.breakdown-container {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.breakdown-container h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.breakdown-bar {
    height: 25px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    margin-bottom: 15px;
}

.principal-bar {
    background: #4e73df;
    height: 100%;
    transition: width 0.5s ease;
}

.interest-bar {
    background: #1cc88a;
    height: 100%;
    transition: width 0.5s ease;
}

.breakdown-labels {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.breakdown-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #2c3e50;
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.principal-dot {
    background: #4e73df;
}

.interest-dot {
    background: #1cc88a;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .emi-calculator-container {
        padding: 20px;
    }
    
    .emi-form {
        padding: 20px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .emi-calculator-container {
        padding: 15px;
    }
    
    .emi-header h2 {
        font-size: 24px;
    }
    
    .emi-form {
        padding: 15px;
    }
    
    .tenure-container {
        flex-direction: column;
    }
    
    .tenure-container select {
        width: 100%;
        padding: 14px 15px;
    }
    
    .result-card {
        flex-direction: column;
        text-align: center;
    }
}