/* ==========================================================================
   CLIENTS AGENT - STYLES
   ========================================================================== */

/* Container principal */
.clients-agent-container {
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* En-tête */
.clients-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.clients-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

/* Filtres */
.clients-filters {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.client-filter {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.3s;
    min-width: 150px;
}

.client-filter:hover,
.client-filter:focus {
    border-color: #4CAF50;
    outline: none;
}

.btn-reset {
    padding: 8px 16px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-reset:hover {
    background: #e0e0e0;
    border-color: #bbb;
}

/* Tableau */
.clients-table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
}

.clients-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.clients-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.clients-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: #495057;
    white-space: nowrap;
    vertical-align: middle;
}

.clients-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s;
}

.clients-table tbody tr:hover {
    background-color: #f8f9fa;
}

.clients-table td {
    padding: 10px 12px;
    font-size: 12px;
    color: #212529;
    vertical-align: middle;
}

/* Nom en gras */
.client-name strong {
    font-size: 13px;
}

/* Téléphone sur une seule ligne */
.clients-table .client-phone {
    font-size: 12px;
    white-space: nowrap;
}

/* Badges type client */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    vertical-align: middle;
}

.badge-particulier {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-professionnel {
    background: #fff3e0;
    color: #f57c00;
}

/* Boutons actions */
.client-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.client-actions button,
.client-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    border: none;
    background: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-decoration: none;
}

.client-actions button:hover,
.client-actions a:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

.btn-view:hover {
    background: #e3f2fd;
}

.btn-edit:hover {
    background: #fff3e0;
}

/* Message aucun client */
.no-clients {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.no-clients p {
    font-size: 16px;
    margin: 0;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #333;
}

#client-details h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

#client-details .detail-row {
    display: flex;
    align-items: center; /* Centrage vertical */
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

#client-details .detail-row:last-child {
    border-bottom: none;
}

#client-details .detail-label {
    font-weight: 600;
    color: #555;
    min-width: 140px;
    display: flex;
    align-items: center; /* Centrage vertical du label */
}

#client-details .detail-value {
    color: #333;
    display: flex;
    align-items: center; /* Centrage vertical de la valeur */
}

/* Bouton edit comme lien */
.btn-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border: none;
    background: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
}

.btn-edit:hover {
    background: #e0e0e0;
    transform: scale(1.1);
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .clients-header {
        flex-direction: column;
        align-items: stretch;
    }

    .clients-filters {
        flex-direction: column;
        width: 100%;
    }

    .filter-group,
    .client-filter {
        width: 100%;
    }

    .clients-table {
        font-size: 12px;
    }

    .clients-table th,
    .clients-table td {
        padding: 8px 10px;
    }

    .client-actions {
        flex-direction: column;
        gap: 4px;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }
}

/* Loading state */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.loading:after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}