/* =============================================================
   Kullanıcı avatarları — emoji karakter + ton (hue) tabanlı gradyan.
   `.ru-avatar` her yerde kullanılır (nav, liderlik, profil, seçici).
   Renk tek değişkenle gelir: --av-hue (0..360).
   ============================================================= */
.ru-avatar {
    --av-size: 2.8rem;
    display: inline-grid;
    place-items: center;
    width: var(--av-size);
    height: var(--av-size);
    flex: 0 0 auto;
    border-radius: 30%;
    background:
        radial-gradient(120% 120% at 28% 22%, rgba(255, 255, 255, 0.45), transparent 55%),
        linear-gradient(145deg, hsl(var(--av-hue, 230) 78% 66%), hsl(calc(var(--av-hue, 230) + 40) 70% 50%));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        0 5px 14px hsl(var(--av-hue, 230) 55% 48% / 0.3);
    overflow: hidden;
    user-select: none;
}

.ru-avatar-face {
    font-size: calc(var(--av-size) * 0.56);
    line-height: 1;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

.ru-avatar--sm { --av-size: 2rem; border-radius: 28%; }
.ru-avatar--md { --av-size: 2.8rem; }
.ru-avatar--lg { --av-size: 3.7rem; }
.ru-avatar--xl { --av-size: 6.2rem; border-radius: 27%; }

.ru-avatar--ring {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        0 0 0 3px var(--app-surface-strong, #fff),
        0 0 0 5px hsl(var(--av-hue, 230) 70% 56% / 0.55),
        0 8px 20px hsl(var(--av-hue, 230) 55% 48% / 0.28);
}

/* ── Seçim modalı (profil içi, ayrı sayfa yok) ────────────────── */
.avatar-modal {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xl);
    background: var(--app-surface-strong);
    box-shadow: var(--app-shadow);
}

.avatar-modal .modal-header {
    border-bottom: 1px solid var(--app-border);
}

.avatar-modal .modal-title {
    color: var(--app-title);
    font-weight: 900;
}

.avatar-modal .modal-title .bi { color: var(--app-primary); }

.avatar-modal-hint {
    margin: 0 0 1rem;
    color: var(--app-text-soft);
    font-size: 0.88rem;
}

/* İsim etiketi YOK — sadece avatar karoları. */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 0.7rem;
    margin: 0;
}

.avatar-option {
    position: relative;
    display: grid;
    place-items: center;
    padding: 0.65rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    background: var(--app-surface);
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.avatar-option:hover {
    transform: translateY(-3px);
    border-color: hsl(var(--av-hue, 230) 70% 58% / 0.6);
    box-shadow: 0 12px 26px hsl(var(--av-hue, 230) 55% 50% / 0.18);
}

.avatar-option:focus-visible {
    outline: none;
    border-color: rgba(var(--app-primary-rgb), 0.6);
    box-shadow: 0 0 0 3px rgba(var(--app-primary-rgb), 0.22);
}

.avatar-option.is-current {
    border-color: hsl(var(--av-hue, 230) 70% 55%);
    background:
        radial-gradient(120% 120% at 50% 0%, hsl(var(--av-hue, 230) 75% 60% / 0.14), transparent 65%),
        var(--app-surface);
    box-shadow: 0 0 0 2px hsl(var(--av-hue, 230) 70% 55% / 0.45), 0 12px 26px hsl(var(--av-hue, 230) 55% 50% / 0.2);
}

.avatar-option.is-current::after {
    content: "\F26E"; /* bootstrap check-circle-fill */
    font-family: "bootstrap-icons";
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    color: hsl(var(--av-hue, 230) 60% 46%);
    font-size: 1rem;
    line-height: 1;
    background: var(--app-surface);
    border-radius: 50%;
}

@media (prefers-reduced-motion: reduce) {
    .avatar-option { transition: none; }
}


/* ── Fotoğraf avatar: yüklenen görsel emoji karesinin yerini alır ── */
.ru-avatar--photo {
    background: var(--app-surface, #fff);
}

.ru-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Profilde avatarın kendisi tıklanır — ayrı buton yok ── */
.profile-avatar-trigger {
    position: relative;
    display: inline-grid;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    border-radius: 30%;
}

.profile-avatar-trigger .ru-avatar {
    transition: transform 0.18s ease, filter 0.18s ease;
}

.profile-avatar-trigger:hover .ru-avatar,
.profile-avatar-trigger:focus-visible .ru-avatar {
    transform: scale(1.04);
    filter: brightness(1.05);
}

.profile-avatar-trigger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--app-primary-rgb), 0.35);
}

.profile-avatar-trigger-hint {
    position: absolute;
    right: -0.3rem;
    bottom: -0.3rem;
    display: grid;
    place-items: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    background: var(--app-surface-strong, #fff);
    border: 1px solid var(--app-border);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
    color: var(--app-primary);
    font-size: 0.9rem;
    transition: transform 0.18s ease;
}

.profile-avatar-trigger:hover .profile-avatar-trigger-hint {
    transform: scale(1.12);
}

@media (prefers-reduced-motion: reduce) {
    .profile-avatar-trigger .ru-avatar,
    .profile-avatar-trigger-hint { transition: none; }
}

/* ── Modal içi fotoğraf yükleme paneli ── */
.avatar-photo-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    border: 1px dashed rgba(var(--app-primary-rgb), 0.35);
    border-radius: var(--app-radius-lg);
    background: rgba(var(--app-primary-rgb), 0.05);
}

.avatar-photo-copy {
    display: grid;
    gap: 0.15rem;
}

.avatar-photo-copy strong {
    color: var(--app-title);
    font-size: 0.92rem;
}

.avatar-photo-copy span {
    color: var(--app-text-soft);
    font-size: 0.8rem;
}

.avatar-photo-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.avatar-photo-upload {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    background: var(--app-primary);
    color: #fff;
    font-size: 0.84rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.16s ease, filter 0.16s ease;
}

.avatar-photo-upload:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.avatar-photo-remove {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(220, 38, 38, 0.35);
    background: none;
    color: #dc2626;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.16s ease;
}

.avatar-photo-remove:hover {
    background: rgba(220, 38, 38, 0.08);
}

html.dark-mode .avatar-photo-remove {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.4);
}
