/* ============================================================================
   VOX Avatar Components — avatar-components.css
   Sistema de avatar reutilizável com borda na cor da entidade
   ============================================================================ */

/* Base avatar */
.vox-avatar {
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    border: 3px solid #ccc;
    flex-shrink: 0;
    vertical-align: middle;
    object-fit: cover;
    background: var(--border-light);
}

/* Sizes */
.vox-avatar-xs { width: 24px; height: 24px; font-size: 0.6rem; border-width: 2px; }
.vox-avatar-sm { width: 32px; height: 32px; font-size: 0.7rem; }
.vox-avatar-md { width: 40px; height: 40px; font-size: 0.85rem; }
.vox-avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; border-width: 3.5px; }

/* Initials (no photo) */
.vox-avatar-initials {
    background: var(--text-secondary);
    color: #fff;
    user-select: none;
}

/* Wrapper (single) */
.vox-avatar-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    position: relative;
}

/* Name beside avatar */
.vox-avatar-name {
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

/* ============================================================================
   Stack — overlapping avatars
   ============================================================================ */
.vox-avatar-stack {
    display: inline-flex;
    align-items: center;
}

.vox-avatar-stack .vox-avatar-wrapper {
    margin-left: -8px;
    gap: 0;
}

.vox-avatar-stack .vox-avatar-wrapper:first-child {
    margin-left: 0;
}

.vox-avatar-stack .vox-avatar {
    transition: transform 0.15s;
}

.vox-avatar-stack .vox-avatar-wrapper:hover {
    z-index: 20 !important;
}

.vox-avatar-stack .vox-avatar-wrapper:hover .vox-avatar {
    transform: scale(1.15);
}

/* "+N" circle */
.vox-avatar-extra {
    background: #6c757d;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    margin-left: -10px;
    border: 3px solid #6c757d;
    position: relative;
    z-index: 0;
    transition: background 0.15s, transform 0.15s, border-color 0.15s;
}

.vox-avatar-extra:hover {
    background: #495057;
    border-color: #495057;
    transform: scale(1.15);
    z-index: 20 !important;
}

/* ============================================================================
   Popover (Bootstrap 5)
   ============================================================================ */
.vox-popover-content {
    min-width: 200px;
    padding: 0.25rem;
}

.vox-popover-content .vox-popover-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.vox-popover-content .vox-popover-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ccc;
    flex-shrink: 0;
}

.vox-popover-content .vox-popover-initials {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}

.vox-popover-content .vox-popover-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.1rem;
}

.vox-popover-content .vox-popover-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
}

.vox-popover-content .vox-popover-details {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.vox-popover-content .vox-popover-details span {
    font-size: 0.8rem;
    color: #6c757d;
}

.vox-popover-content .vox-popover-details i {
    width: 14px;
    text-align: center;
    margin-right: 0.35rem;
}

/* ============================================================================
   Organization Avatar — logo com proporções preservadas (object-fit: contain)
   ============================================================================ */
.vox-avatar-org {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    vertical-align: middle;
    object-fit: contain;
    border-radius: 4px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

/* Sizes — max-width + max-height, aspecto livre (logo decide dimensões) */
.vox-avatar-org-xs { max-width: 28px; max-height: 28px; min-height: 20px; }
.vox-avatar-org-sm { max-width: 36px; max-height: 36px; min-height: 24px; }
.vox-avatar-org-md { max-width: 48px; max-height: 48px; min-height: 32px; }
.vox-avatar-org-lg { max-width: 64px; max-height: 64px; min-height: 40px; }

/* Initials fallback (no logo) */
.vox-avatar-org-initials {
    background: linear-gradient(135deg, var(--color-organizacoes, #8a7a6a), #a89888);
    color: #fff;
    font-weight: 700;
    user-select: none;
    padding: 2px;
}
.vox-avatar-org-initials.vox-avatar-org-xs { font-size: 0.6rem; width: 28px; height: 28px; }
.vox-avatar-org-initials.vox-avatar-org-sm { font-size: 0.7rem; width: 36px; height: 36px; }
.vox-avatar-org-initials.vox-avatar-org-md { font-size: 0.85rem; width: 48px; height: 48px; }
.vox-avatar-org-initials.vox-avatar-org-lg { font-size: 1.1rem; width: 64px; height: 64px; }

/* Wrapper */
.vox-avatar-org-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Name beside org avatar */
.vox-avatar-org-name {
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

/* ============================================================================
   Organization Avatar Stack — logos sobrepostos (margin negativo)
   ============================================================================ */
.vox-avatar-org-stack .vox-avatar-org-wrapper:not(:first-child) {
    margin-left: -8px;
}
.vox-avatar-org-stack .vox-avatar-org-wrapper {
    gap: 0;
}
.vox-avatar-org-stack .vox-avatar-org {
    border: 2px solid #fff;
}
.vox-avatar-org-plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--color-organizacoes, #5a8a68);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    margin-left: -8px;
    border: 2px solid #fff;
    z-index: 1;
    flex-shrink: 0;
}
.vox-avatar-org-plus.vox-avatar-org-xs { width: 28px; height: 28px; }
.vox-avatar-org-plus.vox-avatar-org-sm { width: 36px; height: 36px; font-size: 0.7rem; }
.vox-avatar-org-plus.vox-avatar-org-md { width: 48px; height: 48px; font-size: 0.8rem; }
.vox-avatar-org-plus.vox-avatar-org-lg { width: 64px; height: 64px; font-size: 0.9rem; }

/* ============================================================================
   Modal user item hover
   ============================================================================ */
.vox-modal-user-item {
    transition: background 0.15s, border-color 0.15s;
}
.vox-modal-user-item:hover {
    background: #f8f9fa !important;
    border-color: #adb5bd !important;
}

/* ─── Dark mode ─── */
[data-bs-theme="dark"] .vox-avatar-org { background: var(--card-secondary); border-color: var(--border-color); }
[data-bs-theme="dark"] .vox-avatar-org-stack .vox-avatar-org { border-color: var(--card-primary); }
[data-bs-theme="dark"] .vox-avatar-org-plus { border-color: var(--card-primary); }
[data-bs-theme="dark"] .vox-modal-user-item:hover { background: var(--panel-hover) !important; border-color: var(--border-color) !important; }
