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

/* ==========================================================================
   Styles pour les cartes clients Sellsy (inspirés de cdclient_users)
   ========================================================================== */

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

/* Carte individuelle client Sellsy */
.sellsy-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;
    border: 2px solid transparent;
}

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

/* Barre colorée selon le statut */
.sellsy-client-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    opacity: 0;
    transition: opacity 0.3s;
}

.sellsy-client-card.imported::before {
    background: linear-gradient(90deg, #38a169 0%, #48bb78 100%);
}

.sellsy-client-card.non-imported::before {
    background: linear-gradient(90deg, #ed8936 0%, #f6ad55 100%);
}

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

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

.sellsy-client-card .logo-placeholder {
    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;
}

/* Informations du client */
.sellsy-client-card .client-info {
    text-align: center;
    margin-bottom: 20px;
}

.sellsy-client-card .client-name {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.sellsy-client-card .client-details {
    margin-bottom: 15px;
}

.sellsy-client-card .client-email,
.sellsy-client-card .client-phone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: #718096;
    margin: 8px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sellsy-client-card .client-email svg,
.sellsy-client-card .client-phone svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.sellsy-client-card .client-type {
    display: inline-block;
    padding: 4px 12px;
    background: #f7fafc;
    color: #4a5568;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Actions et badges */
.sellsy-client-card .client-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.sellsy-client-card .status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sellsy-client-card .status-badge.imported {
    background: #c6f6d5;
    color: #22543d;
}

.sellsy-client-card .status-badge svg {
    width: 16px;
    height: 16px;
}

/* Boutons d'action */
.sellsy-client-card .import-btn,
.sellsy-client-card .sync-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    min-width: 140px;
}

.sellsy-client-card .import-btn {
    background: var(--cdclient-main-color, #4299e1);
    color: white;
}

.sellsy-client-card .import-btn:hover {
    background: var(--cdclient-secondary-color, #3182ce);
    transform: translateY(-1px);
}

.sellsy-client-card .sync-btn {
    background: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.sellsy-client-card .sync-btn:hover {
    background: #e2e8f0;
    color: #2d3748;
    transform: translateY(-1px);
}

.sellsy-client-card .import-btn svg,
.sellsy-client-card .sync-btn svg {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   Styles pour les statistiques et filtres
   ========================================================================== */

/* Cartes de statistiques */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card.total .stat-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-card.imported .stat-icon {
    background: linear-gradient(135deg, #38a169 0%, #48bb78 100%);
    color: white;
}

.stat-card.pending .stat-icon {
    background: linear-gradient(135deg, #ed8936 0%, #f6ad55 100%);
    color: white;
}

.stat-card .stat-content h3 {
    font-size: 14px;
    font-weight: 600;
    color: #718096;
    margin: 0 0 5px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-number {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}

/* Section des filtres */
.filters-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.filter-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid #e2e8f0;
    background: white;
    color: #718096;
    border-radius: 25px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.filter-btn:hover {
    border-color: #cbd5e0;
    color: #4a5568;
}

.filter-btn.active {
    background: var(--cdclient-main-color, #4299e1);
    border-color: var(--cdclient-main-color, #4299e1);
    color: white;
}

.filter-btn svg {
    width: 16px;
    height: 16px;
}

/* Boîte de recherche */
.search-box {
    position: relative;
    min-width: 300px;
    flex-shrink: 0;
}

.search-box svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #718096;
    pointer-events: none;
    width: 20px;
    height: 20px;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.2s;
    background: white;
    color: #2d3748;
}

.search-box input:focus {
    outline: none;
    border-color: var(--cdclient-main-color, #4299e1);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.search-box input::placeholder {
    color: #a0aec0;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .sellsy-clients-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .sellsy-client-card {
        padding: 20px;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .filters-section {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .search-box {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .sellsy-client-card .client-email,
    .sellsy-client-card .client-phone {
        font-size: 12px;
    }
    
    .sellsy-client-card .import-btn,
    .sellsy-client-card .sync-btn {
        min-width: 120px;
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* ==========================================================================
   Styles pour la pagination AJAX et les spinners de chargement
   ========================================================================== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
}

.loading-spinner.small {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

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

#loading-indicator {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.load-more-section {
    margin-top: 30px;
    text-align: center;
}

#load-more-btn {
    background: var(--cdclient-main-color, #4299e1);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#load-more-btn:hover {
    background: var(--cdclient-secondary-color, #3182ce);
    transform: translateY(-1px);
}

#load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.clients-info {
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}