:root {
    --primary-color: #2563eb;    /* Brand Blue */
    --secondary-color: #3b82f6;  /* Lighter Blue */
    --accent-color: #f59e0b;     /* Golden Yellow */
    --text-color: #1e293b;       /* Dark Gray */
    --bg-color: #f8fafc;         /* Light Background */
    --success-green: #10b981;    /* Green for totals */
}

/* Base Styles */
.emi-wrapper {
    max-width: 800px;
    margin: 2rem auto;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.calculator-card {
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

/* Header Section */
.calculator-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem;
    text-align: center;
    border-bottom: 3px solid rgba(255,255,255,0.1);
}

.calculator-header h2 {
    margin: 0;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    justify-content: center;
    font-weight: 600;
}

.calculator-header p {
    opacity: 0.9;
    margin: 0.8rem 0 0;
    font-size: 0.95rem;
}

/* Input Section */
.calculator-body {
    padding: 2rem;
    background: var(--bg-color);
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
}

.input-group input, .tenure-input {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.input-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.tenure-input {
    display: flex;
    gap: 0.8rem;
}

#tenureType {
    background: white;
    border-color: #cbd5e1;
}

/* Button Styles */
.calculate-btn {
    width: 100%;
    padding: 1.1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.calculate-btn:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.2);
}

/* Results Section */
.calculator-results {
    padding: 2rem;
    background: white;
    border-top: 3px solid var(--bg-color);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.result-card {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.result-title {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
    font-weight: 500;
}

.result-value {
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: 700;
}

#totalPayment {
    color: var(--success-green);
}

/* Chart Styles */
.chart-container {
    max-width: 280px;
    margin: 2rem auto 0;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

/* Error Messages */
.error-message {
    color: #dc2626;
    background: #fef2f2;
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #fecaca;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .calculator-header {
        padding: 1.5rem;
    }
    
    .calculator-header h2 {
        font-size: 1.5rem;
    }
    
    .calculator-body, .calculator-results {
        padding: 1.5rem;
    }
    
    .result-value {
        font-size: 1.3rem;
    }
}