/* ====================================
   Razorpay EMI Calculator Styles
   ==================================== */

:root {
    --emi-primary-color: #0d6efd;
    --emi-success-color: #198754;
    --emi-border-color: #e0e0e0;
    --emi-bg-light: #f8f9fa;
    --emi-text-primary: #212529;
    --emi-text-secondary: #6c757d;
    --emi-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --emi-radius: 8px;
}

/* Main Container */
.razorpay-emi-calculator {
    background: #fff;
    border: 1px solid var(--emi-border-color);
    border-radius: var(--emi-radius);
    padding: 20px;
    margin: 20px 0;
    box-shadow: var(--emi-shadow);
}

/* Header */
.emi-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.emi-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--emi-primary-color) 0%, #0056b3 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.emi-title-wrapper {
    flex: 1;
}

.emi-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--emi-text-primary);
    line-height: 1.3;
}

.emi-subtitle {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--emi-text-secondary);
    line-height: 1.4;
}

/* Form */
.emi-calculator-form {
    margin-bottom: 20px;
}

.emi-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

@media (max-width: 768px) {
    .emi-form-row {
        grid-template-columns: 1fr;
    }
}

.emi-form-group {
    display: flex;
    flex-direction: column;
}

.emi-form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--emi-text-primary);
    margin-bottom: 6px;
}

.emi-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--emi-border-color);
    border-radius: 6px;
    background: #fff;
    color: var(--emi-text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.emi-select:focus {
    outline: none;
    border-color: var(--emi-primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.emi-select:hover {
    border-color: var(--emi-primary-color);
}

/* Buttons */
.emi-calculate-btn {
    width: 100%;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--emi-primary-color) 0%, #0056b3 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.emi-calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

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

.emi-calculate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Quick View */
.emi-quick-view {
    margin-top: 15px;
    text-align: center;
}

.emi-view-all-btn {
    background: transparent;
    border: 1px solid var(--emi-primary-color);
    color: var(--emi-primary-color);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.emi-view-all-btn:hover {
    background: var(--emi-primary-color);
    color: #fff;
}

.emi-view-all-btn svg {
    transition: transform 0.3s ease;
}

.emi-view-all-btn:hover svg {
    transform: translateX(3px);
}

/* Result */
.emi-result {
    background: linear-gradient(135deg, #f0f7ff 0%, #e3f2fd 100%);
    border-radius: var(--emi-radius);
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

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

.emi-result-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.emi-result-item {
    background: #fff;
    padding: 12px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.emi-label {
    font-size: 12px;
    color: var(--emi-text-secondary);
    font-weight: 500;
    text-transform: uppercase;
}

.emi-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--emi-primary-color);
}

.emi-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--emi-text-secondary);
    padding: 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
}

.emi-info svg {
    flex-shrink: 0;
    color: var(--emi-primary-color);
}

/* Loader */
.emi-loader {
    text-align: center;
    padding: 30px;
    color: var(--emi-text-secondary);
}

.emi-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--emi-border-color);
    border-top-color: var(--emi-primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Modal */
.emi-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.emi-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.emi-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.emi-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--emi-border-color);
}

.emi-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--emi-text-primary);
}

.emi-modal-close {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--emi-text-secondary);
    transition: all 0.3s ease;
}

.emi-modal-close:hover {
    background: var(--emi-bg-light);
    color: var(--emi-text-primary);
}

.emi-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* Plans Table */
.emi-plans-table {
    width: 100%;
    border-collapse: collapse;
}

.emi-plans-table thead {
    background: var(--emi-bg-light);
    position: sticky;
    top: 0;
    z-index: 10;
}

.emi-plans-table th {
    padding: 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--emi-text-primary);
    border-bottom: 2px solid var(--emi-border-color);
}

.emi-plans-table td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--emi-border-color);
    font-size: 14px;
}

.emi-plans-table tbody tr {
    transition: background 0.2s ease;
}

.emi-plans-table tbody tr:hover {
    background: var(--emi-bg-light);
}

.emi-bank-name {
    font-weight: 600;
    color: var(--emi-text-primary);
}

.emi-tenure-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--emi-bg-light);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.emi-rate {
    color: var(--emi-text-secondary);
    font-size: 13px;
}

.emi-amount-highlight {
    font-weight: 700;
    color: var(--emi-primary-color);
    font-size: 16px;
}

.emi-plans-loader {
    text-align: center;
    padding: 40px 20px;
    color: var(--emi-text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .razorpay-emi-calculator {
        padding: 15px;
    }
    
    .emi-modal-content {
        max-height: 95vh;
    }
    
    .emi-result-content {
        grid-template-columns: 1fr;
    }
    
    .emi-plans-table {
        font-size: 12px;
    }
    
    .emi-plans-table th,
    .emi-plans-table td {
        padding: 8px 6px;
    }
}

/* No results message */
.emi-no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--emi-text-secondary);
}

.emi-no-results svg {
    width: 48px;
    height: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}
