/* ====================================================================
   BLOG COMMENTS - REACTIONS
   Animated borders, stickers, picker, all the juicy stuff
   ==================================================================== */

/* ════════════════════════════════════════════════════════════════════
   REACTIONS CONTAINER
   ════════════════════════════════════════════════════════════════════ */

.bc-reactions {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    flex-wrap: wrap;
}

/* ════════════════════════════════════════════════════════════════════
   REACTION BUTTON - BASE
   ════════════════════════════════════════════════════════════════════ */

.bc-reaction {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--io-surface-hover);
    border: 2px solid var(--io-border);
    padding: 6px 12px;
    cursor: pointer;
    border-radius: var(--io-radius-md);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: visible;
}

.bc-reaction:hover {
    transform: translateY(-2px) scale(1.05);
    border-color: var(--io-accent-dim);
    background: var(--io-accent-subtle);
}

.bc-reaction:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.bc-reaction-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.bc-reaction-count {
    color: var(--io-text-primary);
    font-size: var(--io-text-sm);
    font-weight: 600;
    min-width: 14px;
    text-align: center;
    transition: transform 0.3s ease, color 0.3s ease;
}

/* ════════════════════════════════════════════════════════════════════
   REACTION BUTTON - ACTIVE STATE (User has reacted)
   Animated flowing gradient border
   ════════════════════════════════════════════════════════════════════ */

.bc-reaction-active {
    background: var(--io-accent-subtle);
    border-color: transparent;
    z-index: 1;
}

/* Animated gradient border - the magic */
.bc-reaction-active::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: calc(var(--io-radius-md) + 3px);
    padding: 3px;
    
    /* Fallback gradient */
    background: linear-gradient(
        90deg,
        var(--io-accent) 0%,
        var(--io-accent-bright) 25%,
        var(--io-accent-dim) 50%,
        var(--io-accent-bright) 75%,
        var(--io-accent) 100%
    );
    
    background-size: 400% 100%;
    
    /* Mask trick: show only the border stroke */
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    
    animation: bc-border-flow 3s linear infinite;
    pointer-events: none;
}

/* Subtle glow behind active reaction */
.bc-reaction-active::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: calc(var(--io-radius-md) + 4px);
    background: var(--io-accent);
    opacity: 0.15;
    z-index: -1;
    animation: bc-pulse-glow 2s ease-in-out infinite;
    pointer-events: none;
}

.bc-reaction-active .bc-reaction-count {
    color: var(--io-accent-bright);
}

.bc-reaction-active:hover {
    transform: translateY(-2px) scale(1.08);
}

/* ════════════════════════════════════════════════════════════════════
   KEYFRAMES - BORDER FLOW & GLOW
   ════════════════════════════════════════════════════════════════════ */

@keyframes bc-border-flow {
    0% { 
        background-position: 0% 50%; 
    }
    100% { 
        background-position: 400% 50%; 
    }
}

@keyframes bc-pulse-glow {
    0%, 100% { 
        opacity: 0.1; 
        transform: scale(1); 
    }
    50% { 
        opacity: 0.25; 
        transform: scale(1.02); 
    }
}

/* ════════════════════════════════════════════════════════════════════
   ADD REACTION BUTTON
   ════════════════════════════════════════════════════════════════════ */

.bc-reaction-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: transparent;
    border: 2px dashed var(--io-border);
    color: var(--io-text-tertiary);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: var(--io-radius-md);
}

.bc-reaction-add:hover {
    border-color: var(--io-accent);
    border-style: solid;
    color: var(--io-accent);
    background: var(--io-accent-subtle);
    transform: scale(1.05);
}

.bc-reaction-add:active {
    transform: scale(0.95);
}

/* ════════════════════════════════════════════════════════════════════
   REACTION PICKER
   ════════════════════════════════════════════════════════════════════ */

.bc-reaction-picker {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 0;
    background: var(--io-surface-overlay);
    border: 1px solid var(--io-border);
    padding: var(--io-space-md);
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    z-index: var(--io-z-dropdown);
    opacity: 0;
    transform: translateY(8px) scale(0.9);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: var(--io-radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.bc-reaction-picker.bc-picker-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.bc-picker-item {
    width: 52px;
    height: 52px;
    background: var(--io-surface-hover);
    border: 2px solid transparent;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: var(--io-radius-md);
}

.bc-picker-item:hover {
    border-color: var(--io-accent);
    background: var(--io-accent-subtle);
    transform: scale(1.2) rotate(5deg);
}

.bc-picker-item:active {
    transform: scale(0.9);
}

.bc-picker-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ════════════════════════════════════════════════════════════════════
   APPEAR ANIMATION (New reaction added)
   ════════════════════════════════════════════════════════════════════ */

.bc-reaction.bc-appearing {
    animation: bc-appear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bc-appear {
    0% {
        transform: scale(0.5) rotate(-15deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.15) rotate(5deg);
        opacity: 0.9;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* ════════════════════════════════════════════════════════════════════
   COUNT BOUNCE (When count updates)
   ════════════════════════════════════════════════════════════════════ */

.bc-reaction-count.bc-updating {
    animation: bc-count-bounce 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bc-count-bounce {
    0% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.5); 
        color: var(--io-accent-bright); 
    }
    100% { 
        transform: scale(1); 
    }
}

/* ════════════════════════════════════════════════════════════════════
   REACTION POP (When user clicks their own reaction)
   ════════════════════════════════════════════════════════════════════ */

.bc-reaction.bc-popping {
    animation: bc-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bc-pop {
    0% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.25); 
    }
    100% { 
        transform: scale(1); 
    }
}

/* ════════════════════════════════════════════════════════════════════
   REMOVE ANIMATION (Reaction being removed)
   ════════════════════════════════════════════════════════════════════ */

.bc-reaction.bc-removing {
    animation: bc-remove 0.25s ease-out forwards;
}

@keyframes bc-remove {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.5) rotate(10deg);
        opacity: 0;
    }
}

/* ════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .bc-reaction-picker {
        grid-template-columns: repeat(4, 1fr);
        left: -20px;
    }

    .bc-picker-item {
        width: 48px;
        height: 48px;
    }

    .bc-reaction-img {
        width: 20px;
        height: 20px;
    }

    .bc-reaction {
        padding: 5px 10px;
    }

    .bc-reaction-add {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}