/* Sistema de Menções e Notificações */

/* === Scrollbars globais (discretos, tema escuro) === */
/* Firefox */
* {
  scrollbar-width: thin;                 /* fino */
  scrollbar-color: rgba(107,114,128,.45) transparent; /* polegar cinza-500 translucido, trilho transparente */
}

/* WebKit (Chrome, Edge, Safari) */
/* Largura/altura finas */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

/* Trilho transparente para mesclar com o fundo escuro */
::-webkit-scrollbar-track {
  background: transparent;
}

/* Polegar arredondado com leve contraste */
::-webkit-scrollbar-thumb {
  background-color: rgba(107,114,128,.45); /* gray-500 ~ #6b7280 */
  border-radius: 9999px;
  border: 2px solid transparent;           /* cria um "padding" ao redor para ficar mais discreto */
  background-clip: padding-box;
}

/* Hover um pouco mais visível, ainda discreto */
::-webkit-scrollbar-thumb:hover {
  background-color: rgba(156,163,175,.55); /* gray-400 */
}

/* Sem cantos visíveis em contêineres scrollables */
::-webkit-scrollbar-corner {
  background: transparent;
}

/* Ajuste específico para a lista de notificações para evitar trilho claro */
#notifications-list::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.04);
}
#notifications-list { scrollbar-color: rgba(107,114,128,.45) rgba(255,255,255,0.04); }

/* ===== Responsividade do conteúdo de artigos ===== */
.article-content,
.article-content p,
.article-content li,
.article-content blockquote {
  overflow-wrap: anywhere; /* quebra sequências sem espaço */
  word-break: break-word;  /* compatibilidade extra */
}

/* tabelas e code blocks não estourarem a largura */
.article-content table,
.article-content pre,
.article-content code {
  max-width: 100%;
  overflow-x: auto;
}

/* imagens dentro do conteúdo sempre responsivas */
.article-content img {
  max-width: 100%;
  height: auto;
}

/* Dropdown de menções */
.mention-dropdown {
    background: rgba(23, 23, 23, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(64, 64, 64, 0.3);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.mention-item {
    transition: background-color 0.15s ease;
}

.mention-item:hover,
.mention-item.selected {
    background-color: rgba(64, 64, 64, 0.5) !important;
}

.mention-item .user-avatar {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}

/* Links de menções no texto */
.mention-link {
    background: rgba(59, 130, 246, 0.1);
    border-radius: 4px;
    padding: 1px 4px;
    text-decoration: none;
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: all 0.15s ease;
}

.mention-link:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    text-decoration: none;
}

/* Dropdown de notificações */
.notification-dropdown {
    background: rgba(23, 23, 23, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(64, 64, 64, 0.3);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.notification-dropdown::-webkit-scrollbar {
    width: 6px;
}

.notification-dropdown::-webkit-scrollbar-track {
    background: rgba(64, 64, 64, 0.1);
}

.notification-dropdown::-webkit-scrollbar-thumb {
    background: rgba(64, 64, 64, 0.5);
    border-radius: 3px;
}

.notification-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(64, 64, 64, 0.7);
}

/* Badge de notificações */
.notification-badge {
    font-size: 10px;
    line-height: 1;
    min-width: 18px;
    height: 18px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Animações */
.mention-dropdown,
.notification-dropdown {
    animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estados de notificações */
.notification-item {
    transition: background-color 0.15s ease;
}

.notification-item:hover {
    background-color: rgba(64, 64, 64, 0.3);
}

.notification-item.unread {
    border-left: 3px solid #3b82f6;
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #3b82f6, #8b5cf6);
}

/* Responsividade */
@media (max-width: 640px) {
    .notification-dropdown {
        width: 300px;
        right: -50px;
    }
    
    .mention-dropdown {
        width: 250px;
    }
}

/* Estados de loading */
.mention-loading {
    padding: 12px;
    text-align: center;
    color: rgba(156, 163, 175, 0.7);
    font-size: 14px;
}

.mention-loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(156, 163, 175, 0.3);
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

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

/* Melhorias visuais para textareas com menções */
textarea.mention-enabled {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
}

textarea.mention-enabled:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Indicador visual de menção sendo digitada */
.mention-highlight {
    background: rgba(59, 130, 246, 0.1);
    border-radius: 2px;
}

/* Tooltip para menções */
.mention-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

.mention-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -4px;
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}
