/* ========================================
   STYLES POUR LE SIMULATEUR DE PRÊT - COCEC
   ======================================== */

.loan-simulator-section {
    position: relative;
    overflow: hidden;
}

.loan-simulator-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f8f9fa;
    pointer-events: none;
}

.loan-simulator-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    padding: 40px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(236, 40, 28, 0.1);
}

.loan-simulator-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #EC281C;
}

.simulator-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f8f9fa;
}

.simulator-header h3 {
    color: #EC281C;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.simulator-header h3 i {
    margin-right: 10px;
    color: #EC281C;
}

.simulator-header p {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
}

/* Filtres du tableau */
.table-filters {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid rgba(236, 40, 28, 0.1);
}

.table-filters .row {
    align-items: end;
}

.table-filters .col-md-4 {
    margin-bottom: 15px;
}

.table-filters .col-md-12 {
    margin-top: 10px;
}

.table-filters .bz-primary-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    margin: 0 5px;
}

.form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-select {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #fff;
    color: #495057;
}

.form-select:focus {
    border-color: #EC281C;
    box-shadow: 0 0 0 0.2rem rgba(236, 40, 28, 0.25);
    outline: none;
}

.form-control {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #fff;
    color: #495057;
}

.form-control:focus {
    border-color: #EC281C;
    box-shadow: 0 0 0 0.2rem rgba(236, 40, 28, 0.25);
    outline: none;
}

/* Tableau des résultats */
.loan-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.loan-table th {
    background: #EC281C;
    color: #fff;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.loan-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}

.loan-table tr:hover {
    background: #f8f9fa;
}

/* Loading spinner */
#loanTableLoading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #EC281C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Informations du prêt */
.loan-info {
    background: linear-gradient(135deg, #EC281C 0%, #ff6b6b 100%);
    color: #fff;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.loan-info h4 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 20px;
    text-align: center;
}

.loan-info .info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.loan-info .info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.loan-info .info-item span {
    font-size: 14px;
    opacity: 0.9;
}

.loan-info .info-item strong {
    font-size: 16px;
    font-weight: 700;
}

/* Actions de simulation */
.simulation-actions {
    text-align: center;
    margin-top: 30px;
}

.simulation-actions .bz-primary-btn {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.simulation-actions .bz-primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(236, 40, 28, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .loan-simulator-card {
        padding: 25px;
        margin: 0 15px;
    }
    
    .simulator-header h3 {
        font-size: 24px;
    }
    
    .simulation-form {
        padding: 20px;
    }
    
    .simulation-form .row > div {
        margin-bottom: 15px;
    }
    
    .result-card {
        margin-bottom: 20px;
    }
    
    .amortization-table-wrapper {
        overflow-x: auto;
    }
    
    .amortization-table-wrapper .table {
        font-size: 12px;
    }
    
    .amortization-table-wrapper .table thead th,
    .amortization-table-wrapper .table tbody td {
        padding: 8px 5px;
    }
    
    .table-filters .col-md-4 {
        margin-bottom: 20px;
    }
    
    .table-filters .col-md-12 {
        margin-top: 15px;
    }
    
    .table-filters .bz-primary-btn {
        display: block;
        width: 100%;
        margin: 5px 0;
    }
    
    .form-select {
        min-height: 50px;
        font-size: 16px; /* Évite le zoom sur iOS */
    }
    
    .simulation-actions .bz-primary-btn {
        display: block;
        margin: 10px 0;
        width: 100%;
    }
    
    .loan-table {
        font-size: 12px;
    }
    
    .loan-table th,
    .loan-table td {
        padding: 10px 8px;
    }
    
    /* Optimisations mobile pour les services */
    .service-item-3 {
        margin-bottom: 30px;
    }
    
    .service-thumb img {
        width: 100%;
        height: auto;
    }
}
