/**
 * HMVIP Reactions UI
 * Sistema de reações proprietário
 *
 * Todos seletores prefixados com .hmvip-reactions-* para evitar conflitos CSS.
 *
 * @since 2.0.0
 */

/* ──────────────────────────────────────────────────────────── */
/* Container Principal */
/* ──────────────────────────────────────────────────────────── */

.hmvip-reactions-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 0;
    position: relative;
    font-family: inherit;
}

/* ──────────────────────────────────────────────────────────── */
/* Barra de Emojis (contagem pública) */
/* ──────────────────────────────────────────────────────────── */

.hmvip-reactions-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.hmvip-reactions-bar--empty {
    /* Sem reações: espaço reservado mas invisível */
    min-height: 32px;
}

/* Botão de emoji individual */
.hmvip-emoji-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.07);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    font-size: 13px;
    color: inherit;
    font-family: inherit;
    line-height: 1;
}

.hmvip-emoji-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: scale(1.05);
}

.hmvip-emoji-btn:active {
    transform: scale(0.97);
}

.hmvip-emoji-btn--reacted {
    background: rgba(255, 180, 0, 0.2);
    border-color: rgba(255, 180, 0, 0.5);
}

.hmvip-emoji-btn--loading {
    opacity: 0.6;
    pointer-events: none;
}

/* SVG do emoji */
.hmvip-emoji-svg {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
}

.hmvip-emoji-svg svg {
    width: 100%;
    height: 100%;
}

/* Contador */
.hmvip-emoji-count {
    font-size: 12px;
    font-weight: 600;
    min-width: 14px;
}

/* ──────────────────────────────────────────────────────────── */
/* Botão "+ Reagir" */
/* ──────────────────────────────────────────────────────────── */

.hmvip-add-reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px dashed rgba(255, 255, 255, 0.25);
    background: transparent;
    cursor: pointer;
    color: inherit;
    opacity: 0.65;
    font-size: 13px;
    font-family: inherit;
    transition: opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.hmvip-add-reaction-btn:hover {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.07);
}

/* ──────────────────────────────────────────────────────────── */
/* Picker de Emoji (popup) */
/* ──────────────────────────────────────────────────────────── */

.hmvip-emoji-picker {
    position: absolute;
    z-index: 9999;
    bottom: calc(100% + 8px);
    left: 0;
    display: none; /* JS toggle */
    background: var(--bb-color-dark-bg, #1a1a2e);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    width: 280px;
    max-width: calc(100vw - 24px);
}

.hmvip-emoji-picker--open {
    display: block;
    animation: hmvipPickerIn 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes hmvipPickerIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hmvip-emoji-picker__grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.hmvip-emoji-picker__item {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    transition: background 0.12s ease;
    position: relative;
}

.hmvip-emoji-picker__item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.hmvip-emoji-picker__item svg {
    width: 26px;
    height: 26px;
}

/* Badge de preço no picker */
.hmvip-emoji-picker__price {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 8px;
    background: rgba(255, 180, 0, 0.85);
    color: #000;
    border-radius: 4px;
    padding: 0 2px;
    line-height: 1.4;
    font-weight: 700;
    white-space: nowrap;
}

/* ──────────────────────────────────────────────────────────── */
/* Tabela de Earnings (só criadores) */
/* ──────────────────────────────────────────────────────────── */

.hmvip-reactions-earnings {
    width: 100%;
    margin-top: 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 180, 0, 0.2);
    overflow: hidden;
    font-size: 13px;
}

.hmvip-reactions-earnings__title {
    padding: 8px 12px;
    cursor: pointer;
    background: rgba(255, 180, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    list-style: none;
    user-select: none;
}

.hmvip-reactions-earnings__title::-webkit-details-marker {
    display: none;
}

.hmvip-reactions-earnings__total {
    color: rgba(255, 180, 0, 0.9);
    font-weight: 700;
}

.hmvip-reactions-earnings__table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(0, 0, 0, 0.2);
}

.hmvip-reactions-earnings__table th,
.hmvip-reactions-earnings__table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hmvip-reactions-earnings__table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.6;
}

.hmvip-reactions-earnings__table tr:last-child td {
    border-bottom: none;
}

.hmvip-emoji-cell svg {
    width: 20px;
    height: 20px;
}

.hmvip-net-earn {
    color: rgba(80, 220, 120, 0.9);
    font-weight: 600;
}

/* ──────────────────────────────────────────────────────────── */
/* Modal de Confirmação de Pagamento */
/* ──────────────────────────────────────────────────────────── */

.hmvip-reaction-payment-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.hmvip-reaction-payment-modal__box {
    background: var(--bb-color-dark-bg, #1a1a2e);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 28px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: hmvipModalIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes hmvipModalIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

.hmvip-reaction-payment-modal__emoji {
    font-size: 48px;
    margin-bottom: 12px;
}

.hmvip-reaction-payment-modal__price {
    font-size: 22px;
    font-weight: 700;
    color: rgba(255, 180, 0, 0.95);
    margin-bottom: 8px;
}

.hmvip-reaction-payment-modal__desc {
    font-size: 14px;
    opacity: 0.7;
    margin-bottom: 20px;
}

.hmvip-reaction-payment-modal__actions {
    display: flex;
    gap: 10px;
}

.hmvip-reaction-payment-modal__confirm {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #ff6b6b, #ffd93d);
    color: #000;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.hmvip-reaction-payment-modal__confirm:hover {
    transform: scale(1.02);
}

.hmvip-reaction-payment-modal__cancel {
    flex: 0 0 auto;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 15px;
}

/* ──────────────────────────────────────────────────────────── */
/* Toast de feedback */
/* ──────────────────────────────────────────────────────────── */

.hmvip-reaction-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--bb-color-dark-bg, #1a1a2e);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    z-index: 99999;
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
    opacity: 0;
    white-space: nowrap;
}

.hmvip-reaction-toast--visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.hmvip-reaction-toast--success { border-color: rgba(80, 220, 120, 0.4); }
.hmvip-reaction-toast--error   { border-color: rgba(255, 80, 80, 0.4); }

/* ──────────────────────────────────────────────────────────── */
/* Responsive */
/* ──────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .hmvip-emoji-picker {
        left: 50%;
        transform: translateX(-50%);
    }

    .hmvip-emoji-picker--open {
        transform: translateX(-50%);
        animation: hmvipPickerInMobile 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    }

    @keyframes hmvipPickerInMobile {
        from { opacity: 0; transform: translateX(-50%) translateY(8px); }
        to   { opacity: 1; transform: translateX(-50%) translateY(0); }
    }
}
