/* EasySocial badges for Kunena/KUnity: collapsible rewards accordion */
.user-badges-accordion,
.user-badges-phone.user-badges-accordion {
    width: 100%;
    margin: 8px auto 0;
    text-align: center;
}

.user-badges-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 32px;
    padding: 5px 12px;
    margin: 0 auto;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    background: #1e4719;
    cursor: pointer;
    list-style: none;
    font: inherit;
    line-height: 1.2;
    text-align: center;
    user-select: none;
}

.user-badges-toggle::-webkit-details-marker {
    display: none;
}

.user-badges-toggle::after {
    content: '';
    width: 7px;
    height: 7px;
    margin-left: 2px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform .18s ease;
}

.user-badges-accordion[open] .user-badges-toggle::after {
    transform: rotate(225deg) translate(-1px, -1px);
}

.user-badges-toggle-label {
    font-weight: 600;
}

.user-badges-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1;
}

.user-badges-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin: 8px auto 0;
    padding: 2px 0 0;
    text-align: center;
}

.user-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    line-height: 1;
    text-decoration: none;
}

.user-badge img {
    display: block;
    width: 32px;
    height: 32px;
    object-fit: contain;
    margin: 0;
    border: 1px solid #562727;
    padding: 2px;
    border-radius: 10px;
    background: #3d2909;
    box-sizing: border-box;
}

.user-badges-phone .user-badge img {
    width: 28px;
    height: 28px;
}

.user-badge-title {
    margin-left: 4px;
    font-size: 12px;
}

/* Tooltip with badge title. The native title remains as a fallback. */
.user-badge[data-badge-title]::after {
    content: attr(data-badge-title);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translate(-50%, 4px);
    z-index: 10050;
    width: max-content;
    max-width: 220px;
    padding: 5px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
    text-align: center;
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
}

.user-badge[data-badge-title]::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: calc(100% + 3px);
    transform: translate(-50%, 4px);
    z-index: 10050;
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
}

.user-badge[data-badge-title]:hover::after,
.user-badge[data-badge-title]:hover::before,
.user-badge[data-badge-title]:focus-visible::after,
.user-badge[data-badge-title]:focus-visible::before {
    opacity: 1;
    visibility: visible;
}

.user-badge[data-badge-title]:hover::after,
.user-badge[data-badge-title]:focus-visible::after {
    transform: translate(-50%, 0);
}

.user-badge[data-badge-title]:hover::before,
.user-badge[data-badge-title]:focus-visible::before {
    transform: translate(-50%, 0);
}

/* Rewards accordion is the last item of the desktop author list. */
.user-badges {
    list-style: none;
    text-align: center;
}

.user-badges.user-badges-phone-wrap {
    margin-top: 6px;
}
