.reactions-container {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 15px 0;
    border-top: 1px solid #e5e7eb;
    margin-top: 15px;
}

.reaction-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    position: relative;
    overflow: hidden;
}

.reaction-btn:hover:not(.active):not(.disabled) {
    border-color: #d1d5db;
    background: #f9fafb;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.reaction-btn:active:not(.disabled) {
    transform: translateY(0);
}

/* Active (clicked) state */
.reaction-btn.active {
    cursor: default;
    pointer-events: none;
    animation: pulse 0.3s ease;
}

.reaction-btn.active.feel-same {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.reaction-btn.active.can-relate {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-color: #f093fb;
    color: white;
}

.reaction-btn.active.dont-relate {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-color: #4facfe;
    color: white;
}

/* User-specific reaction highlighting (blue) - More aggressive styling */
.reaction.user-reacted,
.reactions .reaction.user-reacted {
    color: #3b82f6 !important;
}

.reaction.user-reacted i,
.reactions .reaction.user-reacted i {
    color: #3b82f6 !important;
}

.reaction.user-reacted .reaction-count,
.reactions .reaction.user-reacted .reaction-count {
    color: #3b82f6 !important;
    font-weight: 700;
}

/* Thread action user reaction highlighting - More aggressive styling */
.thread__action.user-reacted,
.reactions .thread__action.user-reacted {
    color: #3b82f6 !important;
}

.thread__action.user-reacted i,
.reactions .thread__action.user-reacted i {
    color: #3b82f6 !important;
}

.thread__action.user-reacted span:not(.reaction-count),
.reactions .thread__action.user-reacted span:not(.reaction-count) {
    color: #3b82f6 !important;
}

/* Override any CSS variable usage */
.reaction.user-reacted,
.reactions .reaction.user-reacted,
.thread__action.user-reacted,
.reactions .thread__action.user-reacted {
    color: #3b82f6 !important;
}

/* Force blue color on all child elements */
.reaction.user-reacted *,
.reactions .reaction.user-reacted *,
.thread__action.user-reacted *,
.reactions .thread__action.user-reacted * {
    color: #3b82f6 !important;
}

/* Disabled state - maintain full color scheme but prevent interaction */
.reaction-btn.disabled {
    cursor: not-allowed;
    pointer-events: none;
}

/* Disabled state for thread actions */
.thread__action.disabled {
    cursor: not-allowed;
    pointer-events: none;
}

.reaction.disabled {
    cursor: not-allowed;
    pointer-events: none;
}

/* Icon styling */
.reaction-icon {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.reaction-btn:hover:not(.active):not(.disabled) .reaction-icon {
    transform: scale(1.2);
}

.reaction-btn.active .reaction-icon {
    animation: bounce 0.5s ease;
}

/* Count badge */
.reaction-count {
    font-weight: 600;
    text-align: left;
    margin-right: 3px;
}

.reaction-btn.active .reaction-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Loading state */
.reaction-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.reaction-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Ripple effect on click */
.reaction-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.reaction-btn:active:not(.disabled)::before {
    width: 200px;
    height: 200px;
}

/* Tooltip */
.reaction-btn[data-tooltip] {
    position: relative;
}

.reaction-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 6px 12px;
    color: white;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
}

.reaction-btn:hover[data-tooltip]::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* Visual feedback for reactions with counts */
.reaction-btn.has-reactions,
.reaction.has-reactions,
.reactions .reaction.has-reactions,
.thread__action.has-reactions,
.reactions .thread__action.has-reactions {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-width: 2px;
    color: #ffffff !important;
}

.reaction-btn.has-reactions .reaction-count,
.reaction.has-reactions .reaction-count,
.reactions .reaction.has-reactions .reaction-count,
.thread__action.has-reactions .reaction-count,
.reactions .thread__action.has-reactions .reaction-count {
    color: #ffffff !important;
    font-weight: 700;
    animation: countPulse 0.3s ease;
}

/* Ensure icons and text turn white when has-reactions is applied */
.reaction.has-reactions i,
.reactions .reaction.has-reactions i,
.thread__action.has-reactions i,
.reactions .thread__action.has-reactions i {
    color: #ffffff !important;
}

.thread__action.has-reactions span:not(.reaction-count),
.reactions .thread__action.has-reactions span:not(.reaction-count) {
    color: #ffffff !important;
}

/* Also whiten when only container has class (no class on the action span) */
.reaction.has-reactions .thread__action,
.reaction.has-reactions .thread__action i,
.reaction.has-reactions .thread__action span:not(.reaction-count) {
    color: #ffffff !important;
}

/* --- USER REACTED TAKES PRECEDENCE (BLUE) --- */
/* Container-level precedence */
.reaction.has-reactions.user-reacted,
.reactions .reaction.has-reactions.user-reacted {
    color: #3b82f6 !important;
}
.reaction.has-reactions.user-reacted i,
.reactions .reaction.has-reactions.user-reacted i {
    color: #3b82f6 !important;
}
.reaction.has-reactions.user-reacted .thread__action,
.reactions .reaction.has-reactions.user-reacted .thread__action {
    color: #3b82f6 !important;
}
.reaction.has-reactions.user-reacted .thread__action i,
.reactions .reaction.has-reactions.user-reacted .thread__action i {
    color: #3b82f6 !important;
}
.reaction.has-reactions.user-reacted .thread__action span:not(.reaction-count),
.reactions .reaction.has-reactions.user-reacted .thread__action span:not(.reaction-count) {
    color: #3b82f6 !important;
}
.reaction.has-reactions.user-reacted .reaction-count,
.reactions .reaction.has-reactions.user-reacted .reaction-count {
    color: #3b82f6 !important;
}

/* Direct action-level precedence */
.thread__action.user-reacted,
.reactions .thread__action.user-reacted {
    color: #3b82f6 !important;
}
.thread__action.user-reacted i,
.reactions .thread__action.user-reacted i {
    color: #3b82f6 !important;
}
.thread__action.user-reacted span:not(.reaction-count),
.reactions .thread__action.user-reacted span:not(.reaction-count) {
    color: #3b82f6 !important;
}
.thread__action.user-reacted .reaction-count,
.reactions .thread__action.user-reacted .reaction-count {
    color: #3b82f6 !important;
}

/* User takes precedence: when both user-reacted and has-reactions are present, show BLUE */
.reaction.has-reactions.user-reacted,
.reactions .reaction.has-reactions.user-reacted,
.thread__action.has-reactions.user-reacted,
.reactions .thread__action.has-reactions.user-reacted {
    color: #3b82f6 !important;
}

.reaction.has-reactions.user-reacted i,
.reactions .reaction.has-reactions.user-reacted i,
.thread__action.has-reactions.user-reacted i,
.reactions .thread__action.has-reactions.user-reacted i {
    color: #3b82f6 !important;
}

.reaction.has-reactions.user-reacted .reaction-count,
.reactions .reaction.has-reactions.user-reacted .reaction-count,
.thread__action.has-reactions.user-reacted .reaction-count,
.reactions .thread__action.has-reactions.user-reacted .reaction-count {
    color: #3b82f6 !important;
}

@keyframes countPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* WebSocket connection status indicator removed */

/* Responsive */
@media (max-width: 640px) {
    .reactions-container {
        flex-wrap: wrap;
        gap: 8px;
    }

    .reaction-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .reaction-icon {
        font-size: 16px;
    }
}

/* ============================================
   ARTICLE CARD STYLING
   ============================================ */
.article-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.article-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.author-name {
    font-weight: 600;
    color: #1f2937;
}

.article-date {
    font-size: 13px;
    color: #6b7280;
}

.article-content {
    color: #374151;
    line-height: 1.6;
    margin-bottom: 15px;
}

.article-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
}