/**
 * Client Name Styles - أنماط عرض اسم العميل المفصل
 * 
 * @version 1.0.0
 * @date 2025-10-02
 */

/* ==================================
   Client Name Wrapper - الحاوية الرئيسية
   ================================== */
.client-name-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
}

/* ==================================
   Client Avatar - صورة العميل
   ================================== */
.client-avatar-container {
    flex-shrink: 0;
}

.client-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.client-avatar.default {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
}

.client-avatar.initials {
    font-size: 16px;
}

/* ==================================
   Client Info Container - معلومات العميل
   ================================== */
.client-info-container {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ==================================
   Client Name with Actions - الاسم مع الإجراءات
   ================================== */
.client-name-with-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.client-name-core {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
}

.client-name-link {
    color: #007cba;
    text-decoration: none;
    transition: all 0.2s ease;
}

.client-name-link:hover {
    color: #005a87;
    text-decoration: underline;
}

.client-name-text {
    color: #1f2937;
}

/* ==================================
   ACF Completion Pill - نسبة الاكتمال
   ================================== */
.acf-completion-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: help;
}

.acf-completion-pill .pct {
    line-height: 1;
}

.acf-completion-pill .ring-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid currentColor;
    display: inline-block;
}

/* Completion Levels */
.acf-completion-pill.high {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.acf-completion-pill.medium {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.acf-completion-pill.low {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.acf-completion-pill.empty {
    background: #e5e7eb;
    color: #6b7280;
}

/* ==================================
   Client Meta - البيانات الوصفية
   ================================== */
.client-meta-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
    flex-wrap: wrap;
}

.client-meta-inline .legal-entity {
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
    color: #374151;
}

.client-meta-inline .age-display {
    color: #007cba;
    font-weight: 500;
}

.client-meta-inline .gender-icon {
    font-size: 14px;
}

/* ==================================
   Client Badges - شارات الأنظمة
   ================================== */
.client-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.client-badges .badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    cursor: default;
}

.client-badges .badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Badge Colors */
.badge.vat-badge.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.badge.law6-badge.active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.badge.inv-badge.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.badge.social-insurance-badge.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.badge.more-badge {
    background: #e5e7eb;
    color: #374151;
    cursor: pointer;
}

.badge.more-badge:hover {
    background: #d1d5db;
}

/* ==================================
   Hidden Badges Tooltip - نافذة الشارات المخفية
   ================================== */
.hidden-badges-tooltip {
    animation: fadeInUp 0.2s ease;
}

.hidden-badges-tooltip .badge {
    margin: 0;
    width: 100%;
    justify-content: flex-start;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================================
   Responsive - التصميم المتجاوب
   ================================== */
@media (max-width: 768px) {
    .client-name-wrapper {
        flex-direction: column;
        gap: 8px;
    }

    .client-avatar {
        width: 32px;
        height: 32px;
    }

    .client-name-core {
        font-size: 13px;
    }

    .acf-completion-pill {
        font-size: 10px;
        padding: 2px 6px;
    }

    .client-meta-inline {
        font-size: 11px;
    }

    .client-badges .badge {
        font-size: 9px;
        padding: 2px 6px;
    }
}

/* ==================================
   Dark Mode Support - دعم الوضع الداكن
   ================================== */
body.dark-mode .client-name-wrapper {
    color: #e5e7eb;
}

body.dark-mode .client-name-core,
body.dark-mode .client-name-text {
    color: #f3f4f6;
}

body.dark-mode .client-name-link {
    color: #60a5fa;
}

body.dark-mode .client-name-link:hover {
    color: #93c5fd;
}

body.dark-mode .client-avatar {
    border-color: #374151;
}

body.dark-mode .client-meta-inline {
    color: #9ca3af;
}

body.dark-mode .client-meta-inline .legal-entity {
    background: #374151;
    color: #e5e7eb;
}

body.dark-mode .badge.more-badge {
    background: #374151;
    color: #e5e7eb;
}

body.dark-mode .badge.more-badge:hover {
    background: #4b5563;
}

body.dark-mode .hidden-badges-tooltip {
    background: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}
