/**
 * User Engagement Styles
 * CSS for like/dislike buttons, save functionality, and engagement UI
 */

/* Engagement buttons container */
.engagement-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 0;
    border-top: 1px solid #eee;
}

.engagement-buttons.compact {
    gap: 6px;
    margin-top: 6px;
    padding: 6px 0;
}

/* Base button styles */
.btn-engagement {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.btn-engagement:hover {
    background: #f8f9fa;
    color: #333;
    text-decoration: none;
}

.btn-engagement:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-engagement i {
    font-size: 14px;
}

.btn-engagement .count {
    font-weight: 500;
    min-width: 16px;
    text-align: center;
}

/* Like button */
.btn-like {
    color: #666;
    border-color: #ddd;
}

.btn-like:hover {
    color: #007bff;
    border-color: #007bff;
    background: #f0f8ff;
}

.btn-like.active {
    color: #007bff;
    background: #e3f2fd;
    border-color: #007bff;
}

.btn-like.active i {
    color: #007bff;
}

/* Dislike button */
.btn-dislike {
    color: #666;
    border-color: #ddd;
}

.btn-dislike:hover {
    color: #dc3545;
    border-color: #dc3545;
    background: #fff5f5;
}

.btn-dislike.active {
    color: #dc3545;
    background: #ffebee;
    border-color: #dc3545;
}

.btn-dislike.active i {
    color: #dc3545;
}

/* Save button */
.btn-save {
    color: #666;
    border-color: #ddd;
}

.btn-save:hover {
    color: #ffc107;
    border-color: #ffc107;
    background: #fffbf0;
}

.btn-save.saved {
    color: #ffc107;
    background: #fff8e1;
    border-color: #ffc107;
}

.btn-save.saved i {
    color: #ffc107;
}

/* Compact button style for article lists */
.btn-engagement.compact {
    padding: 4px 8px;
    font-size: 12px;
    gap: 3px;
}

.btn-engagement.compact i {
    font-size: 12px;
}

/* Engagement stats display */
.engagement-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.engagement-stat {
    display: flex;
    align-items: center;
    gap: 3px;
}

.engagement-stat i {
    font-size: 11px;
}

.engagement-score {
    font-weight: 500;
    color: #333;
}

/* Article card engagement section */
.article-card .engagement-buttons {
    border-top: 1px solid #f0f0f0;
    margin-top: 8px;
    padding-top: 8px;
}

/* Article detail page engagement */
.article-detail .engagement-buttons {
    margin: 15px 0;
    padding: 12px 0;
    border-top: 2px solid #eee;
    border-bottom: 1px solid #eee;
}

.article-detail .btn-engagement {
    padding: 8px 16px;
    font-size: 14px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .engagement-buttons {
        gap: 6px;
    }
    
    .btn-engagement {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .btn-engagement .text {
        display: none;
    }
    
    .article-detail .engagement-buttons {
        justify-content: space-around;
    }
    
    .article-detail .btn-engagement {
        flex: 1;
        justify-content: center;
        max-width: 100px;
    }
}

@media (max-width: 480px) {
    .engagement-buttons {
        gap: 4px;
    }
    
    .btn-engagement {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .btn-engagement i {
        font-size: 12px;
    }
}

/* Animation for button interactions */
.btn-engagement.clicked {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.btn-engagement:not(.clicked) {
    transform: scale(1);
}

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

.btn-engagement.loading::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid #ddd;
    border-top: 2px solid #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dark theme support */
.dark-theme .engagement-buttons {
    border-color: #444;
}

.dark-theme .btn-engagement {
    background: #333;
    color: #ccc;
    border-color: #555;
}

.dark-theme .btn-engagement:hover {
    background: #444;
    color: #fff;
}

.dark-theme .btn-like.active {
    background: #1a365d;
    border-color: #2b77ad;
    color: #4da3d4;
}

.dark-theme .btn-dislike.active {
    background: #4a1a1a;
    border-color: #a53939;
    color: #d47474;
}

.dark-theme .btn-save.saved {
    background: #4a3f1a;
    border-color: #a39539;
    color: #d4c474;
}

/* Accessibility improvements */
.btn-engagement:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.btn-engagement:focus:not(:focus-visible) {
    outline: none;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .btn-engagement {
        border-width: 2px;
    }
    
    .btn-engagement.active {
        font-weight: bold;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .btn-engagement,
    .btn-engagement.clicked {
        transition: none;
        transform: none;
    }
    
    .btn-engagement.loading::after {
        animation: none;
    }
}