/* ===================================================================
   EMI CALCULATOR MODAL - COMPACT PROFESSIONAL SIZE
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* EMI Calculator Button - Homepage */
.emi-calculator-btn {
    position: fixed;
    bottom: 140px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(251, 191, 36, 0.4);
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s ease;
    border: none;
}

.emi-calculator-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(251, 191, 36, 0.6);
}

.emi-calculator-btn i {
    font-size: 1.5rem;
    color: white;
}

/* Modal Overlay */
.emi-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.emi-modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal Container - COMPACT SIZE */
.emi-modal-container {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.2);
    animation: slideUp 0.4s ease;
    font-family: 'Inter', sans-serif;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Header - COMPACT */
.emi-modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.emi-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd700 0%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.emi-modal-subtitle {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-top: 4px;
}

.emi-close-btn {
    background: rgba(148, 163, 184, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #cbd5e1;
}

.emi-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Modal Body - COMPACT */
.emi-modal-body {
    padding: 28px;
}

.emi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* Input Card - COMPACT */
.emi-input-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 14px;
    padding: 24px 20px;
}

.emi-input-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 20px;
}

/* Input Group - COMPACT */
.emi-input-group {
    margin-bottom: 22px;
}

.emi-input-group:last-child {
    margin-bottom: 0;
}

.emi-input-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.emi-label-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.emi-label-text i {
    color: #fbbf24;
    font-size: 0.875rem;
}

.emi-value {
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #ffd700 0%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Manual Input Field - COMPACT */
.emi-manual-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.9375rem;
    font-weight: 500;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.emi-manual-input:focus {
    outline: none;
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
}

/* Slider - COMPACT */
.emi-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 8px;
    background: #334155;
    outline: none;
    position: relative;
}

.emi-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700 0%, #fbbf24 100%);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
    transition: all 0.3s ease;
}

.emi-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.emi-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700 0%, #fbbf24 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.emi-range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.6875rem;
    color: #64748b;
}

/* Results Card - COMPACT */
.emi-results-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.emi-main-result {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(30, 41, 59, 0.9) 100%);
    border: 2px solid rgba(251, 191, 36, 0.3);
    border-radius: 14px;
    padding: 24px 20px;
    text-align: center;
}

.emi-main-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
}

.emi-main-value {
    font-size: 2.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd700 0%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
    line-height: 1;
}

.emi-main-subtitle {
    font-size: 0.8125rem;
    color: #94a3b8;
}

/* Summary Grid - COMPACT */
.emi-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.emi-summary-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 10px;
    padding: 18px 16px;
}

.emi-summary-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.emi-summary-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #e2e8f0;
}

/* Breakdown Section - COMPACT */
.emi-breakdown {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 14px;
    padding: 24px 20px;
}

.emi-breakdown h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 16px;
}

.emi-breakdown-bar {
    display: flex;
    height: 32px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.emi-bar-principal {
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
    transition: width 0.6s ease;
}

.emi-bar-interest {
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
    transition: width 0.6s ease;
}

.emi-breakdown-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.emi-breakdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.emi-breakdown-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

.emi-breakdown-info {
    flex: 1;
}

.emi-breakdown-label {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin-bottom: 4px;
}

.emi-breakdown-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #e2e8f0;
}

.emi-breakdown-percent {
    font-size: 0.8125rem;
    color: #64748b;
    margin-left: 6px;
}

/* Mobile Responsive */
@media (max-width: 968px) {
    .emi-modal-container {
        max-width: 95%;
    }
    
    .emi-grid {
        grid-template-columns: 1fr;
    }
    
    .emi-summary-grid {
        grid-template-columns: 1fr;
    }
    
    .emi-breakdown-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .emi-calculator-btn {
        bottom: 120px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .emi-modal-container {
        max-height: 90vh;
        border-radius: 16px;
        max-width: 100%;
    }
    
    .emi-modal-header {
        padding: 20px 18px;
    }
    
    .emi-modal-title {
        font-size: 1.25rem;
    }
    
    .emi-modal-subtitle {
        font-size: 0.8125rem;
    }
    
    .emi-modal-body {
        padding: 20px 18px;
    }
    
    .emi-input-card {
        padding: 20px 16px;
    }
    
    .emi-main-value {
        font-size: 1.875rem;
    }
    
    .emi-breakdown {
        padding: 20px 16px;
    }
    
    .emi-input-group {
        margin-bottom: 18px;
    }
}

/* Scrollbar Styling */
.emi-modal-container::-webkit-scrollbar {
    width: 8px;
}

.emi-modal-container::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 10px;
}

.emi-modal-container::-webkit-scrollbar-thumb {
    background: rgba(251, 191, 36, 0.3);
    border-radius: 10px;
}

.emi-modal-container::-webkit-scrollbar-thumb:hover {
    background: rgba(251, 191, 36, 0.5);
}

/* Dark Mode Compatibility */
body[data-theme="dark"] .emi-modal-container {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

body[data-theme="dark"] .emi-input-card,
body[data-theme="dark"] .emi-summary-card,
body[data-theme="dark"] .emi-breakdown {
    background: rgba(15, 23, 42, 0.6);
}
