/**
 * NPR EMI Calculator Pro - Frontend Styles
 * Complete styling for calculator with amortization table
 */

/* ===== BASE STYLES ===== */
.npr-emi-pro-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    padding: 20px 0;
}

.npr-emi-pro-wrapper * {
    box-sizing: border-box;
}

/* ===== MAIN CONTAINER ===== */
.npr-emi-pro-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto 40px;
    padding: 0 15px;
}

/* ===== CARD STYLES ===== */
.npr-emi-pro-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.npr-emi-pro-card:hover {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
}

.npr-emi-pro-card-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 25px 0;
    color: #1a1a1a;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

/* ===== INPUT GROUPS ===== */
.npr-emi-pro-input-group {
    margin-bottom: 30px;
}

.npr-emi-pro-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #4a4a4a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.npr-emi-pro-input-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.npr-emi-pro-number-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    outline: none;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #333;
}

.npr-emi-pro-number-input:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.npr-emi-pro-currency {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: #666;
    pointer-events: none;
}

.npr-emi-pro-input-wrapper .npr-emi-pro-number-input {
    padding-left: 60px;
}

.npr-emi-pro-percentage {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: #666;
    pointer-events: none;
}

.npr-emi-pro-input-wrapper:has(.npr-emi-pro-percentage) .npr-emi-pro-number-input {
    padding-right: 45px;
}

/* ===== SLIDERS ===== */
.npr-emi-pro-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #dc3545 0%, #dc3545 50%, #e0e0e0 50%, #e0e0e0 100%);
    outline: none;
    transition: background 0.3s ease;
}

.npr-emi-pro-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #dc3545;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.npr-emi-pro-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.npr-emi-pro-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #dc3545;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.npr-emi-pro-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.npr-emi-pro-range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: #888;
    font-weight: 500;
}

/* ===== CALCULATE BUTTON ===== */
.npr-emi-pro-calculate-btn {
    width: 100%;
    padding: 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 10px;
}

.npr-emi-pro-calculate-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(220, 53, 69, 0.3);
}

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

/* ===== RESULTS GRID ===== */
.npr-emi-pro-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

/* ===== RESULT BOXES ===== */
.npr-emi-pro-result-box {
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.npr-emi-pro-result-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.npr-emi-pro-result-primary {
    border-color: #dc3545;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
}

.npr-emi-pro-result-info {
    border-color: #17a2b8;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.npr-emi-pro-result-warning {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.npr-emi-pro-result-success {
    border-color: #28a745;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.npr-emi-pro-result-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    margin-bottom: 8px;
}

.npr-emi-pro-result-value {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
}

/* ===== SECTION TITLES ===== */
.npr-emi-pro-section-title {
    font-size: 18px;
    font-weight: 700;
    margin: 30px 0 20px 0;
    color: #1a1a1a;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* ===== PAYMENT BREAKDOWN ===== */
.npr-emi-pro-breakdown-section {
    margin-top: 30px;
}

.npr-emi-pro-breakdown-item {
    margin-bottom: 20px;
}

.npr-emi-pro-breakdown-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a4a4a;
}

.npr-emi-pro-progress-bar {
    width: 100%;
    height: 24px;
    background: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.npr-emi-pro-progress-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.npr-emi-pro-progress-primary {
    background: linear-gradient(90deg, #17a2b8 0%, #138496 100%);
}

.npr-emi-pro-progress-warning {
    background: linear-gradient(90deg, #ffc107 0%, #e0a800 100%);
}

.npr-emi-pro-breakdown-amount {
    margin-top: 8px;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

/* ===== BANK RATES ===== */
.npr-emi-pro-bank-rates-section {
    margin-top: 30px;
}

.npr-emi-pro-bank-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.npr-emi-pro-bank-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.npr-emi-pro-bank-item:hover {
    background: #e9ecef;
    border-left-color: #dc3545;
    transform: translateX(5px);
}

.npr-emi-pro-bank-name {
    font-weight: 600;
    color: #333;
}

.npr-emi-pro-bank-rate {
    font-weight: 700;
    color: #dc3545;
    font-size: 16px;
}

/* ===== AMORTIZATION TABLE SECTION ===== */
.npr-emi-pro-breakdown-table-section {
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 0 15px;
}

.npr-emi-pro-breakdown-header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.npr-emi-pro-breakdown-title {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.npr-emi-pro-breakdown-title svg {
    color: #dc3545;
}

.npr-emi-pro-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.npr-emi-pro-toggle-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.npr-emi-pro-toggle-icon {
    transition: transform 0.3s ease;
}

.npr-emi-pro-toggle-btn[data-collapsed="1"] .npr-emi-pro-toggle-icon {
    transform: rotate(-90deg);
}

.npr-emi-pro-breakdown-content {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* ===== TABLE WRAPPER ===== */
.npr-emi-pro-table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ===== BREAKDOWN TABLE ===== */
.npr-emi-pro-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.npr-emi-pro-breakdown-table thead {
    background: #2c3e50;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.npr-emi-pro-breakdown-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #1a252f;
}

.npr-emi-pro-breakdown-table tbody tr {
    transition: all 0.2s ease;
}

.npr-emi-pro-breakdown-table tbody tr:nth-child(odd) {
    background: #ffffff;
}

.npr-emi-pro-breakdown-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.npr-emi-pro-breakdown-table tbody tr:hover {
    background: #e3f2fd;
    transform: scale(1.01);
}

.npr-emi-pro-breakdown-table td {
    padding: 12px;
    font-size: 14px;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
}

.npr-emi-pro-breakdown-table td:first-child {
    font-weight: 700;
    color: #dc3545;
}

/* ===== TABLE SUMMARY ===== */
.npr-emi-pro-table-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 10px;
}

.npr-emi-pro-table-summary p {
    margin: 0;
    font-size: 14px;
}

.npr-emi-pro-summary-note {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-style: italic;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .npr-emi-pro-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .npr-emi-pro-card {
        padding: 20px;
    }
    
    .npr-emi-pro-card-title {
        font-size: 20px;
    }
    
    .npr-emi-pro-results-grid {
        grid-template-columns: 1fr;
    }
    
    .npr-emi-pro-result-value {
        font-size: 20px;
    }
    
    .npr-emi-pro-breakdown-title {
        font-size: 22px;
    }
    
    .npr-emi-pro-breakdown-header-section {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .npr-emi-pro-table-wrapper {
        border-radius: 0;
    }
    
    .npr-emi-pro-breakdown-table {
        font-size: 13px;
    }
    
    .npr-emi-pro-breakdown-table th,
    .npr-emi-pro-breakdown-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .npr-emi-pro-wrapper {
        padding: 10px 0;
    }
    
    .npr-emi-pro-card {
        padding: 15px;
    }
    
    .npr-emi-pro-number-input {
        font-size: 16px;
        padding: 12px 14px;
    }
    
    .npr-emi-pro-calculate-btn {
        font-size: 14px;
        padding: 14px;
    }
    
    .npr-emi-pro-breakdown-content {
        padding: 15px;
    }
    
    .npr-emi-pro-breakdown-table {
        min-width: 500px;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.npr-emi-pro-breakdown-table-section[style*="display: block"] {
    animation: slideIn 0.5s ease;
}

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

.npr-emi-pro-result-box.updated {
    animation: pulse 0.3s ease;
}

/* ===== PRINT STYLES ===== */
@media print {
    .npr-emi-pro-calculate-btn,
    .npr-emi-pro-toggle-btn {
        display: none;
    }
    
    .npr-emi-pro-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    .npr-emi-pro-breakdown-content {
        display: block !important;
    }
    
    .npr-emi-pro-breakdown-table {
        page-break-inside: avoid;
    }
}