/* Material Design 3 - Client Modal Styles */

/* === MODALE CLIENT === */
.client-modal {
    max-width: 700px;
    width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.client-modal .modal-header {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border-bottom: 1px solid var(--border-light);
    padding: 1.5rem 2rem;
}

.modal-title-section {
    flex: 1;
}

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

/* === PROFILE HEADER === */
.client-profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.client-avatar {
    width: 64px;
    height: 64px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.client-avatar .material-icons {
    font-size: 32px;
}

.client-main-info {
    flex: 1;
    min-width: 0;
}

.client-full-name {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    word-wrap: break-word;
}

.client-status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* === STATUS CHIPS === */
.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.status-chip.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-chip.status-inactive {
    background: var(--text-muted);
    color: var(--bg-primary);
    border: 1px solid var(--text-muted);
}

/* === INFO GRID === */
.client-info-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.info-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.info-item:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.info-item .material-icons {
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 20px;
}

.info-content {
    flex: 1;
    min-width: 0;
}

.info-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.info-value {
    display: block;
    font-size: 0.875rem;
    color: var(--text-primary);
    word-wrap: break-word;
    font-weight: 500;
}

.info-value:empty::after {
    content: "—";
    color: var(--text-secondary);
    font-style: italic;
}

/* === NOTES SECTION === */
.client-notes-section {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.client-notes-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.client-notes-section h4::before {
    content: "sticky_note_2";
    font-family: 'Material Icons';
    color: var(--primary);
    font-size: 20px;
}

.notes-content {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-wrap;
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    min-height: 60px;
}

.notes-content:empty::after {
    content: "Aucune note disponible";
    font-style: italic;
    color: var(--text-muted);
}

/* === FORM SECTIONS === */
.form-section {
    margin-bottom: 2rem;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section-title {
    margin: 0 0 1.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section-title::before {
    content: "";
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-row .md-text-field:only-child {
    grid-column: 1 / -1;
}

/* === FOOTER ACTIONS === */
.footer-actions-read,
.footer-actions-edit {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    width: 100%;
}

.footer-actions-read .md-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* === SWITCH DANS HEADER === */
.modal-header-actions .md-switch {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.switch-icon {
    font-size: 16px;
    transition: all var(--transition-fast);
}

.md-switch-input:checked ~ .md-switch-track .switch-icon {
    color: var(--primary);
}

.md-switch-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* === ANIMATIONS === */
.client-modal.show {
    animation: slideInDown 0.3s cubic-bezier(0.2, 0, 0, 1);
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.client-view-mode,
.client-edit-mode {
    animation: fadeIn 0.2s ease;
}

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

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .client-modal {
        max-width: 95vw;
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
    
    .client-modal .modal-header {
        padding: 1rem 1.5rem;
    }
    
    .info-section {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .client-profile-header {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    
    .modal-header-actions {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-end;
    }
    
    .footer-actions-read,
    .footer-actions-edit {
        flex-direction: column;
    }
    
    .client-full-name {
        font-size: 1.5rem;
    }
    
    .info-item {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .client-modal {
        max-width: 100vw;
        margin: 0;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .client-profile-header {
        margin-bottom: 1.5rem;
        padding: 1rem;
    }
    
    .client-avatar {
        width: 48px;
        height: 48px;
    }
    
    .client-avatar .material-icons {
        font-size: 24px;
    }
    
    .client-full-name {
        font-size: 1.25rem;
    }
}

/* === FOCUS STATES === */
.info-item:focus-within {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.md-button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* === LOADING STATE === */
.client-modal.loading .client-modal-body {
    position: relative;
    min-height: 400px;
}

.client-modal.loading .client-modal-body::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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