/* Material Design 3 - Clients Page Styles */

.clients-page {
    padding: 2rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    position: relative;
    min-height: 100vh;
}

/* === HEADER === */
.clients-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.clients-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.clients-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* === BOUTON NOUVEAU CLIENT === */
.add-client-section {
    margin-bottom: 2rem;
}

.add-client-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
}

.add-client-button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-light);
}

/* === FILTRES STYLE RÉSERVATIONS === */
.clients-filter-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.clients-count {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.md-segmented-button-set {
    display: flex;
    gap: 0.5rem;
}

.md-segmented-button {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.md-segmented-button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.md-segmented-button.md-segmented-button--selected,
.md-segmented-button[aria-pressed="true"] {
    background: var(--primary);
    color: white;
}

.md-segmented-button .material-icons {
    font-size: 18px;
}

/* === SEARCH SECTION === */
.search-section {
    margin-bottom: 2rem;
    position: relative;
    max-width: 400px;
}

.md-text-field {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.md-text-field-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
}

.md-text-field-input::placeholder {
    color: var(--text-secondary);
}

.md-text-field-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.md-text-field .md-icon-button {
    position: absolute;
    right: 8px;
    z-index: 1;
}

.md-text-field .md-icon-button:last-child {
    right: 56px; /* Pour faire place au bouton search */
}

/* === BULK ACTIONS === */
.bulk-actions-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    margin-bottom: 16px;
    background-color: var(--md-sys-color-secondary-container);
    border-radius: var(--md-sys-shape-corner-medium);
    animation: slideDown 200ms cubic-bezier(0.2, 0, 0, 1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bulk-actions-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--md-sys-color-on-secondary-container);
    font-weight: 500;
}

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

/* === TABLE CONTAINER === */
.clients-table-container {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: all 0.2s ease;
}

/* === TABLE STYLES === */
.clients-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    background: var(--bg-tertiary);
}

.clients-table thead {
    background: var(--bg-tertiary);
}

.clients-table th {
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    user-select: none;
    background: var(--bg-tertiary);
}

.clients-table th.sortable {
    cursor: pointer;
    transition: background-color 150ms cubic-bezier(0.2, 0, 0, 1);
}

.clients-table th.sortable:hover {
    background: var(--bg-hover);
}

.clients-table th.sortable:focus {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    background: var(--primary-light);
}

.sortable-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.sort-indicator {
    font-size: 18px;
    color: var(--text-secondary);
    transition: color 150ms cubic-bezier(0.2, 0, 0, 1);
}

.sort-indicator.asc,
.sort-indicator.desc {
    color: var(--primary);
}

.clients-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
    background: var(--bg-tertiary);
}

.clients-table tbody tr:hover {
    background: var(--bg-hover);
}

.clients-table tbody tr:focus-within {
    background: var(--primary-light);
}

/* === CHECKBOX COLUMN === */
.checkbox-column {
    width: 48px;
    text-align: center;
}

.checkbox-column input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* === ACTIONS COLUMN === */
.actions-column {
    width: 200px;
    text-align: center;
}

.action-buttons {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
}

.action-buttons .md-icon-button {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-buttons .md-icon-button:hover {
    background: var(--bg-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.action-buttons .md-icon-button .material-icons {
    font-size: 18px;
}

/* Boutons spécifiques */
.action-buttons .md-icon-button[title*="Voir"] {
    color: var(--info);
    border-color: var(--info);
}

.action-buttons .md-icon-button[title*="Modifier"] {
    color: var(--warning);
    border-color: var(--warning);
}

.action-buttons .md-icon-button[title*="Appeler"] {
    color: var(--success);
    border-color: var(--success);
}

.action-buttons .md-icon-button[title*="Supprimer"] {
    color: var(--error);
    border-color: var(--error);
}

/* === STATUS BADGES === */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.status-badge.status-new {
    background: var(--info-light);
    color: var(--info);
    border: 1px solid var(--info);
}

.status-badge.status-regular {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-badge.status-vip {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #333;
    border: 1px solid #ffd700;
    box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.status-badge.status-inactive {
    background: var(--text-muted);
    color: var(--bg-primary);
    border: 1px solid var(--text-muted);
}

/* === PAGINATION === */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

/* === EMPTY STATE === */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
    color: var(--md-sys-color-on-surface-variant);
}

.empty-state .material-icons {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 400;
    margin: 0 0 8px 0;
    color: var(--md-sys-color-on-surface);
}

.empty-state p {
    font-size: 14px;
    margin: 0;
    max-width: 320px;
    line-height: 20px;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .clients-page {
        padding: 1rem;
    }
    
    .clients-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .clients-actions {
        justify-content: center;
    }
    
    .bulk-actions-section {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .md-fab--extended {
        bottom: 16px;
        right: 16px;
    }
}

@media (max-width: 768px) {
    .clients-title {
        font-size: 24px;
        line-height: 32px;
        text-align: center;
    }
    
    .clients-stats {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }
    
    .md-segmented-button-set {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .md-segmented-button {
        min-width: 80px;
        padding: 8px 16px;
    }
    
    .clients-table-container {
        overflow-x: auto;
    }
    
    .clients-table {
        min-width: 700px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 2px;
    }
    
    .add-client-button {
        font-size: 14px;
        min-height: 48px;
        padding: 12px 16px;
    }
}

/* === FOCUS MANAGEMENT === */
.md-button:focus-visible,
.md-icon-button:focus-visible,
.md-fab:focus-visible {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: 2px;
}

/* === LOADING STATES === */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid var(--md-sys-color-primary);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}