/**
 * Estilos para el Sistema de Menciones
 * Compatible con el diseño de Mastodon
 */

.mention-dropdown {
    background: #ffffff;
    border: 1px solid #dfe3e8;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    min-width: 280px;
    max-width: 320px;
}

.mention-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
}

.mention-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 4px;
    margin: 2px 4px;
}

.mention-item:hover,
.mention-item.selected {
    background-color: #f4f5f7;
}

.mention-item.selected {
    background-color: #e8eaed;
}

.mention-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mention-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.mention-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.mention-name {
    font-weight: 600;
    font-size: 14px;
    color: #1c1e21;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mention-username {
    font-size: 13px;
    color: #65676b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.no-results {
    padding: 16px 12px;
    text-align: center;
    color: #65676b;
    font-size: 14px;
}

/* Scrollbar personalizado para el dropdown */
.mention-dropdown::-webkit-scrollbar {
    width: 8px;
}

.mention-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.mention-dropdown::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.mention-dropdown::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animación de entrada */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mention-dropdown[style*="display: block"] {
    animation: slideIn 0.2s ease;
}

/* Estilos para menciones en el texto */
.mention {
    color: #0066cc;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.mention:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .mention-dropdown {
        max-width: calc(100vw - 40px);
        min-width: 260px;
    }
    
    .mention-avatar {
        width: 36px;
        height: 36px;
    }
    
    .mention-name {
        font-size: 13px;
    }
    
    .mention-username {
        font-size: 12px;
    }
}

/* Modo oscuro (opcional) */
@media (prefers-color-scheme: dark) {
    .mention-dropdown {
        background: #242526;
        border-color: #3e4042;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }
    
    .mention-item:hover,
    .mention-item.selected {
        background-color: #3a3b3c;
    }
    
    .mention-item.selected {
        background-color: #4e4f50;
    }
    
    .mention-name {
        color: #e4e6eb;
    }
    
    .mention-username {
        color: #b0b3b8;
    }
    
    .no-results {
        color: #b0b3b8;
    }
    
    .mention {
        color: #2d88ff;
    }
}

/* Compatibilidad con el editor ByteMD */
.bytemd .mention-dropdown {
    z-index: 10001 !important;
}

/* Estilos para el textarea cuando está activo */
textarea:focus {
    outline: none;
}

/* Loading state */
.mention-dropdown.loading {
    padding: 16px;
    text-align: center;
}

.mention-dropdown.loading::after {
    content: "Buscando usuarios...";
    color: #65676b;
    font-size: 14px;
}

/* Indicador de mención en el post */
.mentioned-user-badge {
    display: inline-flex;
    align-items: center;
    background: #e7f3ff;
    color: #0066cc;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin: 2px;
}

.mentioned-user-badge img {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 4px;
}
