/**
 * ============================================================================
 * SISTEMA DE ENGAJAMENTO VIVO PARA POSTS
 * ============================================================================
 * Elementos sutis e úteis que tornam a página mais dinâmica
 * 
 * Componentes:
 * 1. Barra de Progresso de Leitura
 * 2. Notificações de Comentários Reais
 * 3. Recomendação Inteligente de Artigo Relacionado
 */

/* ============================================================================
   1. BARRA DE PROGRESSO DE LEITURA
   ============================================================================ */

.reading-progress-bar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 0% !important;
    height: 3px !important;
    background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%) !important;
    z-index: 999999 !important;
    transition: width 0.1s ease-out !important;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3) !important;
    pointer-events: none !important;
}

/* Garantir que aparece acima de tudo */
body > .reading-progress-bar {
    display: block !important;
}

/* ============================================================================
   2. NOTIFICAÇÕES DE COMENTÁRIOS REAIS
   ============================================================================ */

.comment-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 350px;
    z-index: 9998;
    cursor: pointer;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 4px solid #2563eb;
}

.comment-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.comment-notification:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.comment-notification-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
}

.comment-notification-content {
    flex: 1;
    min-width: 0;
}

.comment-notification-name {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 2px;
}

.comment-notification-text {
    font-size: 13px;
    color: #6b7280;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.comment-notification-icon {
    color: #2563eb;
    font-size: 18px;
}

/* ============================================================================
   3. RECOMENDAÇÃO INTELIGENTE DE ARTIGO
   ============================================================================ */

.recommended-article-box {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-width: 320px;
    z-index: 9998;
    transform: translateX(-400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 2px solid #e5e7eb;
}

.recommended-article-box.show {
    transform: translateX(0);
    opacity: 1;
}

.recommended-article-box:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    border-color: #2563eb;
}

.recommended-article-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #2563eb;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recommended-article-header i {
    font-size: 14px;
}

.recommended-article-content {
    text-decoration: none;
    display: block;
    transition: transform 0.2s ease;
}

.recommended-article-content:hover {
    transform: translateX(4px);
}

.recommended-article-thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
}

.recommended-article-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recommended-article-excerpt {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

.recommended-article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #9ca3af;
}

.recommended-article-meta i {
    color: #2563eb;
}

.recommended-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.recommended-close-btn:hover {
    color: #1f2937;
}

/* ============================================================================
   RESPONSIVO
   ============================================================================ */

@media (max-width: 768px) {
    .comment-notification {
        right: 10px;
        bottom: 10px;
        max-width: calc(100% - 20px);
    }
    
    .recommended-article-box {
        left: 10px;
        bottom: 10px;
        max-width: calc(100% - 20px);
    }
    
    /* Empilhar quando ambos aparecem */
    .comment-notification.with-recommendation {
        bottom: 200px;
    }
}

/* ============================================================================
   ANIMAÇÕES
   ============================================================================ */

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 12px 32px rgba(37, 99, 235, 0.2);
    }
}

.comment-notification.show {
    animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.recommended-article-box.show {
    animation: slideInLeft 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
