/**
 * post-reactions.css
 * 
 * "Was this helpful?" reaction bar for posts.
 * Matches the site's Outfit / indigo design language.
 *
 * @since 1.4.0
 */

/* ========================================
   Reaction Bar Container
======================================== */
.cb-reactions-section {
    margin: 40px 0;
    padding: 28px 32px;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f5f3ff 100%);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.cb-reactions-question {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px 0;
    font-family: var(--cb-font-main, 'Outfit', sans-serif);
}

/* ========================================
   Reaction Buttons
======================================== */
.cb-reactions-buttons {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.cb-reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.25s ease;
    font-family: inherit;
    line-height: 1;
}

.cb-reaction-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Helpful button */
.cb-reaction-btn--like {
    background: #fff;
    color: #16a34a;
    border-color: #bbf7d0;
}

.cb-reaction-btn--like:hover {
    background: #f0fdf4;
    border-color: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.15);
}

/* Not helpful button */
.cb-reaction-btn--dislike {
    background: #fff;
    color: #dc2626;
    border-color: #fecaca;
}

.cb-reaction-btn--dislike:hover {
    background: #fef2f2;
    border-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.15);
}

/* Active / voted state */
.cb-reaction-btn.is-active {
    transform: none;
    cursor: default;
    pointer-events: none;
}

.cb-reaction-btn--like.is-active {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}

.cb-reaction-btn--dislike.is-active {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

/* Disabled after voting */
.cb-reactions-buttons.has-voted .cb-reaction-btn:not(.is-active) {
    opacity: 0.4;
    pointer-events: none;
    transform: none;
}

/* ========================================
   Reaction Count
======================================== */
.cb-reaction-count {
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 20px;
}

/* ========================================
   Progress Bar
======================================== */
.cb-reactions-progress {
    margin-top: 4px;
}

.cb-reactions-bar-track {
    width: 100%;
    max-width: 320px;
    margin: 0 auto 6px;
    height: 6px;
    background: #fecaca;
    border-radius: 50px;
    overflow: hidden;
}

.cb-reactions-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #16a34a, #22c55e);
    border-radius: 50px;
    transition: width 0.5s ease;
    min-width: 2%;
}

.cb-reactions-summary {
    font-size: 0.82rem;
    color: #64748b;
    margin: 0;
}

/* ========================================
   Thank You Message
======================================== */
.cb-reactions-thanks {
    display: none;
    font-size: 0.9rem;
    color: #16a34a;
    font-weight: 600;
    margin-top: 8px;
    animation: cbFadeIn 0.4s ease;
}

.cb-reactions-thanks.is-visible {
    display: block;
}

@keyframes cbFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Responsive — Tablet
======================================== */
@media (max-width: 768px) {
    .cb-reactions-section {
        padding: 22px 20px;
        margin: 32px 0;
        border-radius: 14px;
    }

    .cb-reactions-question {
        font-size: 0.95rem;
        margin-bottom: 14px;
    }

    .cb-reactions-buttons {
        gap: 10px;
    }

    .cb-reaction-btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    .cb-reactions-bar-track {
        max-width: 280px;
    }
}

/* ========================================
   Responsive — Mobile
======================================== */
@media (max-width: 480px) {
    .cb-reactions-section {
        padding: 20px 16px;
        margin: 24px 0;
        border-radius: 12px;
    }

    .cb-reactions-question {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }

    .cb-reactions-buttons {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .cb-reaction-btn {
        padding: 12px 20px;
        font-size: 0.88rem;
        gap: 8px;
        justify-content: center;
        border-radius: 12px;
    }

    .cb-reaction-btn svg {
        width: 18px;
        height: 18px;
    }

    .cb-reaction-count {
        font-size: 0.88rem;
    }

    .cb-reactions-bar-track {
        max-width: 100%;
        height: 5px;
    }

    .cb-reactions-summary {
        font-size: 0.78rem;
    }

    .cb-reactions-thanks {
        font-size: 0.84rem;
    }
}