/**
 * Design Rhombus pour le plugin WP CRM
 * Inspiré par l'interface Rhombus Dashboard
 */

/* Variables globales */
:root {
    /* Couleurs principales */
    --primary: #525fe1;
    --primary-light: #7680ff;
    --primary-dark: #3346c0;
    --secondary: #8b5cf6;
    --secondary-light: #a78bfa;
    --accent: #f472b6;
    
    /* Couleurs fonctionnelles */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Couleurs de fond */
    --bg-gradient-start: #e0f2fe;
    --bg-gradient-end: #f9d2ff;
    --bg-content: #f8fafc;
    --bg-card: #ffffff;
    
    /* Couleurs de texte */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-on-primary: #ffffff;
    
    /* Bordures */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* Ombres */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Arrondis */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    
    /* Typographie */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    
    /* Animations */
    --transition: all 0.2s ease;
}

/* Reset et styles de base */
.wp-crm-container {
    font-family: var(--font-sans);
    color: var(--text-primary);
    line-height: 1.5;
    max-width: 100% !important;
    width: 100% !important;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    padding: 30px;
    border-radius: var(--radius-lg);
    min-height: 100vh;
}

/* Couche de fond pour la mise en page */
.wp-crm-layout {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin-bottom: 30px;
    position: relative;
}

/* En-tête */
.wp-crm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border);
    background-color: var(--bg-card);
}

.wp-crm-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.wp-crm-header h1:before {
    content: "◆";
    color: var(--secondary);
    font-size: 16px;
}

/* Barre de recherche */
.wp-crm-search {
    position: relative;
    width: 300px;
}

.wp-crm-search input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 16px 10px 40px;
    font-size: 14px;
    background-color: var(--bg-content);
    transition: var(--transition);
}

.wp-crm-search input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(82, 95, 225, 0.2);
}

.wp-crm-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* Navigation */
.wp-crm-tabs {
    display: flex;
    margin: 0;
    padding: 0 30px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    gap: 6px;
}

.wp-crm-tab {
    padding: 16px 20px;
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}

.wp-crm-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.wp-crm-tab:hover:not(.active) {
    color: var(--text-primary);
    background-color: rgba(82, 95, 225, 0.05);
}

.wp-crm-tab i {
    margin-right: 8px;
    font-size: 16px;
}

/* Contenu */
.wp-crm-content {
    padding: 24px 30px;
    background-color: var(--bg-content);
}

.wp-crm-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.wp-crm-tab-content.active {
    display: block;
}

/* Table de contacts - Style Stripe */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 20px;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

thead th {
    background-color: #f9fafb;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.4;
    vertical-align: middle;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background-color: rgba(82, 95, 225, 0.03);
}

/* Style plus compact pour les tables */
.compact-table thead th {
    padding: 10px 12px;
}

.compact-table tbody td {
    padding: 8px 12px;
}

/* Avatars */
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    font-size: 13px;
    margin-right: 12px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
}

.contact-name {
    display: flex;
    align-items: center;
}

.contact-info {
    display: flex;
    flex-direction: column;
}

.contact-info .name {
    font-weight: 500;
    color: var(--text-primary);
}

.contact-info .date {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Boutons */
.wp-crm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    box-shadow: var(--shadow-sm);
    background-color: white;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.wp-crm-btn:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.wp-crm-btn:active {
    transform: translateY(0);
}

.wp-crm-btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
}

.wp-crm-btn-primary:hover {
    background-color: var(--primary-dark);
    color: white;
}

.wp-crm-btn-danger {
    background-color: var(--danger);
    color: white;
    border: none;
}

.wp-crm-btn i {
    margin-right: 8px;
}

/* Boutons d'action dans le tableau - Style Stripe */
.action-buttons {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.action-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    background-color: rgba(82, 95, 225, 0.05);
    color: var(--primary);
    border-color: rgba(82, 95, 225, 0.2);
}

.action-btn.edit:hover {
    color: var(--info);
    border-color: rgba(59, 130, 246, 0.2);
}

.action-btn.delete:hover {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.action-btn.assign:hover {
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
    color: var(--text-on-primary);
}

.badge.primary {
    background-color: var(--primary);
}

.badge.secondary {
    background-color: var(--secondary);
}

.badge.success {
    background-color: var(--success);
}

.badge.warning {
    background-color: var(--warning);
}

.badge.danger {
    background-color: var(--danger);
}

.badge.info {
    background-color: var(--info);
}

/* Modale */
.wp-crm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.wp-crm-modal.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.wp-crm-modal-content {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wp-crm-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wp-crm-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.wp-crm-modal-close {
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
    background-color: transparent;
}

.wp-crm-modal-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--danger);
}

.wp-crm-modal-body {
    padding: 24px;
}

.wp-crm-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Formulaires */
.wp-crm-form-group {
    margin-bottom: 20px;
}

.wp-crm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-secondary);
}

.wp-crm-form-group input,
.wp-crm-form-group select,
.wp-crm-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    background-color: var(--bg-card);
    transition: var(--transition);
}

.wp-crm-form-group input:focus,
.wp-crm-form-group select:focus,
.wp-crm-form-group textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(82, 95, 225, 0.2);
}

.wp-crm-form-row {
    display: flex;
    gap: 16px;
}

.wp-crm-form-col {
    flex: 1;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 992px) {
    .wp-crm-container {
        padding: 20px;
    }
    
    .wp-crm-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .wp-crm-search {
        width: 100%;
    }
    
    .wp-crm-form-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .wp-crm-tab {
        padding: 12px 16px;
    }
}

@media (max-width: 768px) {
    .wp-crm-container {
        padding: 10px;
    }
    
    .wp-crm-content {
        padding: 16px;
    }
    
    .wp-crm-tabs {
        padding: 0 16px;
        overflow-x: auto;
    }
    
    table {
        display: block;
        overflow-x: auto;
    }
}

/* Personnalisation des contrôles */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    background-color: white;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

input[type="checkbox"]:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Actions en masse */
.bulk-actions {
    background-color: var(--primary);
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.bulk-actions-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bulk-actions-right {
    display: flex;
    gap: 8px;
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
}

.select-all-label input[type="checkbox"] {
    border-color: rgba(255, 255, 255, 0.5);
}

.select-all-label input[type="checkbox"]:checked {
    background-color: white;
    border-color: white;
}

.select-all-label input[type="checkbox"]:checked::after {
    border-color: var(--primary);
}

/* Notifications */
.wp-crm-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 16px 20px;
    border-radius: var(--radius);
    background-color: white;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    max-width: 350px;
    z-index: 1000;
    animation: slideInNotif 0.3s ease;
    border-left: 4px solid var(--primary);
}

.wp-crm-notification.success {
    border-left-color: var(--success);
}

.wp-crm-notification.error {
    border-left-color: var(--danger);
}

.wp-crm-notification.warning {
    border-left-color: var(--warning);
}

.wp-crm-notification-message {
    flex: 1;
    font-size: 14px;
}

.wp-crm-notification-close {
    margin-left: 16px;
    cursor: pointer;
    color: var(--text-secondary);
}

@keyframes slideInNotif {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Créé un loader pour les actions en cours */
.wp-crm-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

.wp-crm-loader.dark {
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* État des lignes */
tr.selected {
    background-color: rgba(82, 95, 225, 0.08);
}

tr.selected:hover {
    background-color: rgba(82, 95, 225, 0.12);
}

/* Admin UI */
.admin-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.admin-name {
    font-weight: 500;
    font-size: 14px;
    line-height: 1.2;
}

.admin-role {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Pagination */
.wp-crm-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
}

.wp-crm-pagination-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    color: var(--text-secondary);
    background-color: white;
    border: 1px solid var(--border);
}

.wp-crm-pagination-item:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

.wp-crm-pagination-item.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Vide et chargement - Style Stripe */
.empty-state {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
    background-color: #fafafa;
    border-radius: var(--radius);
    margin: 20px 0;
}

.empty-state-icon {
    font-size: 40px;
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.7;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state-description {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto;
}

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

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 2px solid rgba(82, 95, 225, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

.loading-text {
    font-size: 14px;
    color: var(--text-secondary);
} 