/* ══════════════════════════════════════════════════════════════════════════════
   user_badge.css — Enhanced User Identity Components
   Standardized Profile Avatars + Country Flag Badges
   ══════════════════════════════════════════════════════════════════════════════ */

:root {
    --badge-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    --badge-glass: rgba(13, 17, 23, 0.7);
    --badge-border: rgba(255, 255, 255, 0.1);
}

/* ── ROOT CONTAINER ── */
.profile-avatar-badge-root {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
    background: transparent;
    padding: 0;
}

.profile-avatar-badge-root:hover {
    transform: scale(1.05);
    z-index: 10;
}

/* ── AVATAR IMAGE / INITIALS ── */
.profile-avatar-badge-root img,
.avatar-initials {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1.5px solid var(--badge-border);
}

.avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2A68FF 0%, #7C61FF 100%);
    color: #FFFFFF;
    font-weight: 700;
    font-size: clamp(0.7rem, 2.5vw, 1.2rem);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    border: none;
}

/* ── COUNTRY FLAG BADGE ── */
.avatar-country-badge {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 20px;
    height: 14px;
    background: var(--badge-glass);
    backdrop-filter: blur(4px) saturate(180%);
    -webkit-backdrop-filter: blur(4px) saturate(180%);
    border: 1px solid var(--badge-border);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--badge-shadow);
    z-index: 2;
}

.avatar-country-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    border: none;
    box-shadow: none;
}

/* ── SIZE VARIATIONS ── */

/* Extra Small (e.g. Activity Feed, Monitor) */
.user-avatar-xs.profile-avatar-badge-root {
    width: 24px;
    height: 24px;
}
.user-avatar-xs .avatar-country-badge {
    width: 11px;
    height: 8px;
    bottom: -1px;
    right: -1px;
    border-radius: 1px;
}
.user-avatar-xs .avatar-initials { font-size: 0.6rem; }

/* Small (e.g. Navigation, Comments) */
.user-avatar-sm.profile-avatar-badge-root {
    width: 32px;
    height: 32px;
}
.user-avatar-sm .avatar-country-badge {
    width: 14px;
    height: 10px;
    bottom: -1px;
    right: -1px;
    border-radius: 2px;
}
.user-avatar-sm .avatar-initials { font-size: 0.75rem; }

/* Medium (e.g. Partner Cards, Feed) */
.user-avatar-md.profile-avatar-badge-root {
    width: 44px;
    height: 44px;
}
.user-avatar-md .avatar-country-badge {
    width: 18px;
    height: 13px;
    bottom: -1px;
    right: -1px;
}
.user-avatar-md .avatar-initials { font-size: 1rem; }

/* Large (e.g. Profile Cards, Modals) */
.user-avatar-lg.profile-avatar-badge-root {
    width: 64px;
    height: 64px;
}
.user-avatar-lg .avatar-country-badge {
    width: 22px;
    height: 16px;
    bottom: 1px;
    right: 1px;
}
.user-avatar-lg .avatar-initials { font-size: 1.4rem; }

/* Extra Large (e.g. Main Profile Header) */
.user-avatar-xl.profile-avatar-badge-root {
    width: 96px;
    height: 96px;
}
.user-avatar-xl .avatar-country-badge {
    width: 28px;
    height: 20px;
    bottom: 4px;
    right: 4px;
    border-width: 1.5px;
}
.user-avatar-xl .avatar-initials { font-size: 2rem; }

/* ── INTERACTIVE STATES ── */
.profile-avatar-badge-root:active {
    transform: scale(0.95);
}

/* Pulse animation for active/learning states (optional use) */
.user-badge-active::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid #2ECC71;
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.3); opacity: 0; }
}

/* ── PROFILE LINK HOVER EFFECTS ── */
.user-profile-link {
    position: relative;
    display: inline-block;
}

.user-profile-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #8597c6, #92aae5);
    border-radius: 2px;
    transition: width 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 8px rgba(42, 198, 255, 0.4);
}

.user-profile-link:hover {
    filter: brightness(1.15);
}

.user-profile-link:hover::after {
    width: 100%;
}

.avatar-profile-link {
    display: inline-flex;
    text-decoration: none;
    vertical-align: middle;
}
