/**
 * REACCIONES DE FOTO - Lightbox oficial
 * Selector tipo Facebook: compacto, moderno, con animación de resorte.
 */

/* ===== Selector flotante de reacciones ===== */
.reaction-picker {
    position: fixed;
    z-index: 10010;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    background:
        radial-gradient(120% 140% at 50% 0%, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 55%),
        linear-gradient(180deg, rgba(44, 44, 48, 0.86) 0%, rgba(24, 24, 27, 0.86) 100%);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.08) inset,
        0 18px 44px rgba(0, 0, 0, 0.5),
        0 4px 12px rgba(0, 0, 0, 0.35);
    transform-origin: bottom center;
    transform: translateY(12px) scale(0.7);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28),
                opacity 0.2s ease;
}

.reaction-picker.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Cada reacción del selector */
.reaction-picker-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    /* Entrada escalonada */
    opacity: 0;
    transform: translateY(10px) scale(0.4);
    animation: reactionPop 0.36s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

.reaction-picker.active .reaction-picker-item {
    animation-delay: var(--delay, 0ms);
}

@keyframes reactionPop {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Halo de color detrás del emoji al hacer hover */
.reaction-picker-item::before {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 45%, var(--rc, #fff) 0%, transparent 72%);
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 0;
}

/* El emoji en sí */
.reaction-emoji-glyph {
    position: relative;
    z-index: 1;
    font-size: 1.7rem;
    line-height: 1;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
    transition: transform 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.reaction-picker-item:hover,
.reaction-picker-item:focus-visible {
    transform: translateY(-12px) scale(1.15);
    outline: none;
}

.reaction-picker-item:hover .reaction-emoji-glyph,
.reaction-picker-item:focus-visible .reaction-emoji-glyph {
    transform: scale(1.28);
}

.reaction-picker-item:hover::before,
.reaction-picker-item:focus-visible::before {
    opacity: 0.35;
    transform: scale(1.15);
}

/* Etiqueta (tooltip) encima de cada reacción al hover */
.reaction-picker-item::after {
    content: attr(data-label);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(6px) scale(0.9);
    background: var(--rc, #000);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    z-index: 2;
}

.reaction-picker-item:hover::after,
.reaction-picker-item:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}

/* ===== Botón de reacción (barra inferior) ===== */
/* Reutiliza .gallery-lightbox-action; aquí solo estados extra */

/* Cuando el botón muestra un emoji de reacción en vez del ícono */
.gallery-lightbox-action .reaction-emoji {
    font-size: 1.35rem;
    line-height: 1;
    display: inline-block;
}

/* Animación al confirmar una reacción propia */
.gallery-lightbox-action.reaction-confirm .reaction-emoji,
.gallery-lightbox-action.reaction-confirm i {
    animation: reactionConfirm 0.45s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes reactionConfirm {
    0%   { transform: scale(0.6); }
    45%  { transform: scale(1.35); }
    70%  { transform: scale(0.92); }
    100% { transform: scale(1); }
}

/* Pequeño destello al reaccionar */
.gallery-lightbox-action.reaction-burst::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0.6;
    animation: reactionBurst 0.5s ease-out forwards;
    pointer-events: none;
}

@keyframes reactionBurst {
    0%   { transform: scale(0.6); opacity: 0.6; }
    100% { transform: scale(1.7); opacity: 0; }
}

/* ===== Contador con transición suave (estilo YouTube) ===== */
.like-counter {
    display: inline-block;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.like-counter.counter-tween {
    animation: counterTween 0.32s ease;
}

@keyframes counterTween {
    0%   { transform: translateY(0); }
    45%  { transform: translateY(-6px); opacity: 0.2; }
    55%  { transform: translateY(6px); opacity: 0.2; }
    100% { transform: translateY(0); opacity: 1; }
}

/* ===== Ícono de reacción en el modal "quién reaccionó" ===== */
.stat-user-reaction {
    margin-left: auto;
    font-size: 1.15rem;
    line-height: 1;
    flex-shrink: 0;
}

/* Responsive: en pantallas chicas, selector un poco más ajustado */
@media (max-width: 480px) {
    .reaction-picker-item {
        width: 42px;
        height: 42px;
    }
    .reaction-emoji-glyph {
        font-size: 1.55rem;
    }
}


/* ===== Mini-popup de "Accede para reaccionar" (invitados) ===== */
.reaction-login-prompt {
    position: fixed;
    z-index: 10011;
    width: 236px;
    padding: 18px 18px 16px;
    background:
        radial-gradient(120% 120% at 50% 0%, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 55%),
        linear-gradient(180deg, rgba(40, 40, 44, 0.92) 0%, rgba(22, 22, 25, 0.92) 100%);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.08) inset,
        0 18px 46px rgba(0, 0, 0, 0.55);
    text-align: center;
    transform-origin: bottom center;
    transform: translateY(12px) scale(0.9);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.26s cubic-bezier(0.18, 0.89, 0.32, 1.28),
                opacity 0.18s ease;
}

.reaction-login-prompt.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.reaction-login-prompt h4 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.reaction-login-prompt p {
    margin: 0 0 14px;
    font-size: 0.8125rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.7);
}

.reaction-login-btn {
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: 999px;
    background: #fff;
    color: #18181b;
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.reaction-login-btn:hover {
    background: #f0f0f0;
}

.reaction-login-btn:active {
    transform: scale(0.97);
}
