/* Loan EMI Calculator Styles */

.loan-emi-calculator {
    max-width: 600px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e1e5e9;
}

.emi-calculator-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    text-align: center;
}

.emi-calculator-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.emi-calculator-header i {
    font-size: 28px;
    color: #ffd700;
}

.emi-calculator-form {
    padding: 30px;
    background: #f8f9fa;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: #667eea;
    width: 16px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
    display: block;
    position: relative;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Hide number input spinners for any remaining number inputs */
.form-group input[type="number"]::-webkit-outer-spin-button,
.form-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-group input[type="number"] {
    -moz-appearance: textfield;
}

.tenure-input-group {
    display: flex;
    gap: 10px;
}

.tenure-input-group input {
    flex: 2;
}

.tenure-input-group select {
    flex: 1;
    min-width: 100px;
}

.calculate-btn {
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.calculate-btn:active {
    transform: translateY(0);
}

.calculate-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.emi-calculator-results {
    padding: 30px;
    background: white;
    border-top: 1px solid #e1e5e9;
}

.emi-calculator-results h4 {
    margin: 0 0 25px 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.emi-calculator-results h4 i {
    color: #667eea;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.result-label {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-label i {
    color: #667eea;
    width: 14px;
}

.result-value {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin-top: 5px;
}

.emi-breakdown {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.emi-breakdown h5 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.emi-breakdown h5 i {
    color: #667eea;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e1e5e9;
    font-size: 14px;
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-item.total {
    font-weight: 600;
    font-size: 16px;
    color: #2c3e50;
    border-top: 2px solid #667eea;
    padding-top: 12px;
    margin-top: 8px;
}

.emi-calculator-error {
    padding: 20px 30px;
    background: #fff5f5;
    border-top: 1px solid #fed7d7;
}

.error-message {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e53e3e;
    font-weight: 500;
}

.error-message i {
    font-size: 18px;
    color: #e53e3e;
}

/* Loading animation */
.calculate-btn.loading {
    position: relative;
    color: transparent;
}

.calculate-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .loan-emi-calculator {
        margin: 10px;
        border-radius: 8px;
    }
    
    .emi-calculator-header {
        padding: 20px;
    }
    
    .emi-calculator-header h3 {
        font-size: 20px;
    }
    
    .emi-calculator-form,
    .emi-calculator-results {
        padding: 20px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .tenure-input-group {
        flex-direction: column;
    }
    
    .tenure-input-group select {
        flex: none;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .emi-calculator-header h3 {
        font-size: 18px;
        flex-direction: column;
        gap: 5px;
    }
    
    .form-group input,
    .form-group select {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .calculate-btn {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .result-value {
        font-size: 20px;
    }
}

/* Animation for results */
.emi-calculator-results {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Success animation */
.result-item.success {
    animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
} 