/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

/* En-tête avec titre et boutons */
.users-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.users-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #363636;
    margin: 0;
    line-height: 1.125;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Bouton Nouvelle Entreprise */
.btn-new-client {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: #48bb78;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-new-client:hover {
    background: #38a169;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
    color: white;
    text-decoration: none;
}

.btn-new-client svg {
    width: 20px;
    height: 20px;
}

/* Grille de clients */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    margin-top:25px
}

.client-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.client-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.client-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4299e1 0%, #667eea 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.client-card:hover::before {
    opacity: 1;
}

/* Logo client */
.client-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    position: relative;
}

.client-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    background: #f7fafc;
    padding: 8px;
}

.logo-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: white;
}

/* Infos client */
.client-info {
    text-align: center;
    margin-bottom: 20px;
}

.client-name {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 5px 0;
}

.client-contact {
    font-size: 14px;
    color: #718096;
    margin: 0 0 5px 0;
}

.client-email {
    font-size: 14px;
    color: #4299e1;
    margin: 0 0 15px 0;
}

.client-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #718096;
}

.stat-item svg {
    width: 16px;
    height: 16px;
}

/* Actions */
.client-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-view-client {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: #4299e1;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-view-client:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

.btn-visit-site {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #718096;
    transition: all 0.2s;
}

.btn-visit-site:hover {
    background: #e2e8f0;
    color: #4a5568;
    transform: translateY(-1px);
}

/* Styles spécifiques pour les entreprises */
.company-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.company-type-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.company-type-badge.individual {
    background: #e0f2fe;
    color: #0277bd;
}

.company-type-badge.corporate {
    background: #f3e5f5;
    color: #7b1fa2;
}

.company-description {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.4;
}

.company-meta {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.creation-date {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #888;
    font-size: 12px;
}

.btn-edit-company {
    padding: 8px;
    border-radius: 6px;
    background: #f8f9fa;
    color: #6c757d;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-edit-company:hover {
    background: #e9ecef;
    color: #495057;
}

.search-box input[type="text"]#searchCompanies {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.search-box input[type="text"]#searchCompanies:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Bouton modifier entreprise */
.btn-edit-company {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f59e0b;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-edit-company:hover {
    background: #d97706;
    transform: translateY(-1px);
    color: white;
}

/* Bouton migrer */
.btn-migrate {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #8b5cf6;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 14px;
    cursor: pointer;
    margin-right: 12px;
}

.btn-migrate:hover {
    background: #7c3aed;
    transform: translateY(-1px);
    color: white;
}

.header-actions {
    display: flex;
    align-items: center;
}

/* Responsive */
@media (max-width: 768px) {
    .users-header {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
    }
    
    .btn-new-client {
        justify-content: center;
    }
    
    .clients-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .client-card {
        padding: 20px;
    }
}

/* Informations d'absence d'entreprise */
.no-company-info {
    padding: 12px;
    background: #fef3c7;
    border-radius: 6px;
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

/* === Statut de synchronisation des adresses === */
.address-sync-status {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.sync-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
}

.sync-status-success {
    color: #059669;
    background: #d1fae5;
    border-color: #a7f3d0;
}

.sync-status-warning {
    color: #d97706;
    background: #fef3c7;
    border-color: #fcd34d;
}

.sync-status-info {
    color: #2563eb;
    background: #dbeafe;
    border-color: #93c5fd;
}

.sync-status-error {
    color: #dc2626;
    background: #fee2e2;
    border-color: #fca5a5;
}

.sync-last-check {
    font-size: 11px;
    color: #6b7280;
    font-style: italic;
}

/* Boutons d'action pour la synchronisation */
.btn-export-address,
.btn-import-address,
.btn-review-addresses {
    padding: 2px 8px;
    font-size: 11px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-export-address {
    background: #f59e0b;
    color: white;
}

.btn-export-address:hover {
    background: #d97706;
}

.btn-import-address {
    background: #2563eb;
    color: white;
}

.btn-import-address:hover {
    background: #1d4ed8;
}

.btn-review-addresses {
    background: #8b5cf6;
    color: white;
}

.btn-review-addresses:hover {
    background: #7c3aed;
}